Apache on trustix

Hello
Instalirao sam trustix 2.0 na moj kompjuter .
Sve radi super osim apache
Napravio sam virtual host
ustvari apache radi samo kada ukucam stranicu www.mojastranica.com uvjek dobijem ovaj error .

HTTP Error 403 - Forbidden
Internet Explorer
na drugom komjuteru imam instaliran freeBSD 4.9 i nemam niki problema
pokusavao sam da nadem u cemu je problem ali nisam uspio

dole nize je moj virtrual host conf
Zamolio bih da ako ko moze da mi pomogne
Hvala unaprijed

www.moja stranica.com

I like to put lots of comments in my setup, it serves me well later as I get

senile and forget what it is that I was trying to do.

The * in the VirtualHost tag, tells apache that any request with unix-girl.com

in the http header falls under this configuration. This is by far the simpler way to

configure virtual hosts on apache, but it is not compatible with some older browsers.

Well, too bad, I don’t have multiple IPs to use, so anyone using a browser before

Http 1.0 will just have to live without seeing my website, sorry, but damn,

get rid of that 8086 and upgrade your browser already!

<VirtualHost *>

This should be self-explanatory, the name and port under which the server

identifies itself. If the port is 80 (default) it is not necessary to include it.

If this is not set to a valid DNS name, server-side redirects will fail.

 ServerName        mojstranica.com

This address shows up on some server-generated pages, so be nice and make it a

real one :slight_smile:

ServerAdmin        admin@mojastranica.com

Other names this server is known by.

ServerAlias        mojstranica.com
ServerAlias       mojstranica.com

Place where the documents for this domain live.

DocumentRoot       /home/users/mojhome/public_html

Directory specifications, this is all explained in the configuration

file itself, and also in the apache documentation.

<Directory />
     Options            FollowSymLinks
     AllowOverride      None
</Directory>

<Directory "/home/users/mojhome/public_html">
     Options            Indexes FollowSymLinks
     AllowOverride      None
     Order              allow,deny
     Allow              from all
</Directory>

Index files, can be more than one, I’m boring :slight_smile:

DirectoryIndex     index.html
DirectoryIndex     index.htm
DirectoryIndex     index.php

Access file - this is where your users can overwrite access for their

directory (if you allow for them to overwrite, that is)

AccessFileName     .htaccess

This whole section deals with logging.

Specify a separate location for this vritual host’s logs and you won’t have to

sift through a 500000000000K line log file to find who’s linking to your collection

of Al Bundy quotes.

Hostname lookups while fun and convenient do slow down the server a tad. I know how to

use nslookup (or dig for newer linux fans).

HostnameLookups    Off
ErrorLog           /home/users/mojhome/logs/error_log

Unless you want your server to crawl… leave it at warn

LogLevel           warn

These are actually the default apache log formats, but if I wanted to log it

differently I could do so easily with this section in here…

LogFormat 	       "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat 	       "%h %l %u %t "%r" %>s %b" common
LogFormat 	       "%{Referer}i -> %U" referer
LogFormat 	       "%{User-agent}i" agent

With all info in one log, it’s easier to read & parse intersting information out.

CustomLog          /home/users/mojhome/logs/access_log combined

This adds a line containing server version and host name to server-generated pages.

Why not?

ServerSignature    On

That’s where those pesky cgi scripts can live for my unix-girl site.

ScriptAlias        /cgi-bin/  "/home/users/mojhome/cgi-bin/"

<Directory "/home/users/mojhome/cgi-bin">
     AllowOverride      None
     Options            None
     Order              allow,deny
     Allow              from all
</Directory>

.cgi files are cgi scripts, yep!

AddHandler         cgi-script .cgi

This tells apache that files contained under ug_pubhtml directory in users’ home

directories should be published under the unix-girl.com domain.

ug_pubhtml, get it? unix-girl public_html, I’m that witty.

UserDir users_pubhtml

This is the error handling part - as in place where pages live that display

errors, by using this directive here I can customize the look of my error

pages, nifty, no?

 <IfModule mod_negotiation.c>
 <IfModule mod_include.c>
 Alias /error/ "/home/users/mojhome/error/"
 
 <Directory "/home/users/mojhome/error">
     AllowOverride None
     Options IncludesNoExec
     AddHandler type-map var
     Order allow,deny
     Allow from all
     LanguagePriority en es de fr
 </Directory>
 </IfModule>
 </IfModule>

The end.

Internet Explorer
ovo je greška :slight_smile: šalim se

probaj staviti IP adresu umjesto zvijezde u <VirtualHost…>

Pokusao sam i restartovao apache i opet nista
to mi se desava sa trustix i ako uzmem redhat dok sa freebsd radi brez problema

Ne znam…

Ja obično koristim name based hosting (http/1.1). Evo npr. neke konfiguracije sa RedHat servera:

NameVirtualHost 192.168.1.1

# Default web stranica, ako neko koristi http/1.0
<VirtualHost 192.168.1.1>
DocumentRoot /var/www/unknown
</VirtualHost>

# Moja domena
<VirtualHost 192.168.1.1>
ServerAdmin webmaster@mojadomena.ba
DocumentRoot /var/www/mojadomena
ServerName mojadomena.ba
ServerAlias www.mojadomena.ba
</VirtualHost>

Ovo dopišeš na dno defaultne konfiguracije. Ako ni to ne bude radilo, onda fakat ne znam. Možda ne bi bilo loše da pošalješ čitavu konfiguraciju (ako misliš da to ugrožava tvoj sigurnosni model, možemo se dogovoriti da mi pošalješ direktno).

ja nebih rekao da je greska u konfiguraciji apache.a…
glupo bi bilo da pitam koja prava ima direktorij public_html… ali ih ipak provjeri…

Pozdrav

ICE