View previous topic :: View next topic |
Author |
Message |
tessmonsta Tux's lil' helper


Joined: 28 Jul 2005 Posts: 114
|
Posted: Mon Aug 08, 2005 4:51 am Post subject: [solved] No DocumentRoot in httpd.conf? |
|
|
I've been building a little webserver for a few weeks now. I've only recently finished installing all the of the required software (I hope), and now I'm starting to set up the configuration.
First off, I'm new to Gentoo. And the settings of /etc/apache2/httpd.conf look somewhat different from those I've seen on other linux distros. For one, I cannot seem to find the DocumentRoot parameter.
I currently have the system setup so that the /home directory is on the larger drive of the system. I was hoping to point the default directory of the server to /home/websitename/public_html, while using the remaining user's web directories as subdomains. I just hope this idea isn't so convoluted that it won't work!
Help, please?
Last edited by tessmonsta on Mon Aug 08, 2005 3:28 pm; edited 1 time in total |
|
Back to top |
|
 |
lnxz Guru

Joined: 03 Jul 2005 Posts: 472 Location: Earth
|
Posted: Mon Aug 08, 2005 5:37 am Post subject: |
|
|
DocumentRoot is a valid parameter, just point it to the top folder containing all the "subdomains". Presuming the rest of the config is correct you should then be able to connect to the different domains by typing http://localhost/<domain> in your browser of choice.
Personally I prefer to have configurations for different domains in separate files, located in vhost.d and have apache source them.
Apache.org has quite OK docs on how to set things up. I didn't have to read alot of it, though, as I found the basic httpd.conf to contain sufficent information to set up a working server.
Hope this answers at least one of your questions, and if not then I misunderstood your problem. |
|
Back to top |
|
 |
tessmonsta Tux's lil' helper


Joined: 28 Jul 2005 Posts: 114
|
Posted: Mon Aug 08, 2005 1:38 pm Post subject: |
|
|
lnxz wrote: | DocumentRoot is a valid parameter, just point it to the top folder containing all the "subdomains". Presuming the rest of the config is correct you should then be able to connect to the different domains by typing http://localhost/<domain> in your browser of choice. |
What I mean by subdomains is something more like: subdomain.maindomain.tld It still looks like the vhosts are the way to go for that but my DocumentRoot problem persists. No matter where I put the directive in httpd.conf, it seems to have no effect. (I am restarting apache after making a change.) So I'm still lost. |
|
Back to top |
|
 |
lnxz Guru

Joined: 03 Jul 2005 Posts: 472 Location: Earth
|
Posted: Mon Aug 08, 2005 2:57 pm Post subject: |
|
|
Hm, ok, now I understand what you mean by subdomain, however I don't know how to accomplish what you want, as I've only used apache for quite simple tasks.
Here's an example of how a vhost config could look like. The directory directive isn't necessary if it's set in the main conf, but it's nice to have for flexibility.
Code: |
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot /var/www/localhost/htdocs
DirectoryIndex index.php index.html
<Directory "/var/www/localhost/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
|
Dunno if this'll help, as it seems like you already have some experience with apache, so this might be old news for you, but at least it shows how DocumentRoot can be used, and if you're already doing something like this and the documentroot doesn't work, then there's something wrong or not quite right in your configuration. |
|
Back to top |
|
 |
DaveArb Guru

Joined: 29 Apr 2004 Posts: 510 Location: Texas, USA
|
Posted: Mon Aug 08, 2005 3:11 pm Post subject: |
|
|
What version of Apache are you using?
I have an Apache server I emerged just last week, 2.0.54-r8 (the latest stable x86 according to packages), and it doesn't use /etc/apache2/httpd.conf as its configuration file, it uses /etc/apache2/apache2.conf and /etc/apache2/commonapache2.conf. DocumentRoot appears in apache2.conf on mine, but I may have changed that from the default.
Dave |
|
Back to top |
|
 |
tessmonsta Tux's lil' helper


Joined: 28 Jul 2005 Posts: 114
|
Posted: Mon Aug 08, 2005 3:28 pm Post subject: |
|
|
lnxz wrote: | Hm, ok, now I understand what you mean by subdomain, however I don't know how to accomplish what you want, as I've only used apache for quite simple tasks.
Here's an example of how a vhost config could look like. The directory directive isn't necessary if it's set in the main conf, but it's nice to have for flexibility.
|
Ahhh! So that's what they did! They must have moved out the default server configuration out to a vhost instead of keeping it in httpd.conf.
Thank you! |
|
Back to top |
|
 |
tessmonsta Tux's lil' helper


Joined: 28 Jul 2005 Posts: 114
|
Posted: Mon Aug 08, 2005 4:37 pm Post subject: |
|
|
DaveArb wrote: | What version of Apache are you using? |
I only emerged it a fwe days ago, so I can't imagine it being any older than that. Originally, the server did use the apache2.conf config file, but the system suggesting updating the config files. Upon doing so, the file no longer appeared necessary and it was removed. |
|
Back to top |
|
 |
|