Apache 2 install config
I just installed apache 2, it is up and running fine, but I can't figure out how to change the root WWW dir from the /apache2 install.
I have found the docs: Code:
Description: Directory that forms the main document tree visible from the web Also I wan't to run a couple of websites on my dynamic ip using no-ip. Will this work: Code:
<VirtualHost *:8088> |
it will be in that config file somewhere, or if your version uses multiple config files for ease of management, you might have a commonapache2.conf too..? I don't see what you mean by not being able to find it though... you've found it in your second code block there... :confused: those virtual hosts look ok to me.
|
Thanks for the reply acid. Both code blocks are from the apache docs, easy to find but NOT easy to understand.
WHY doesn't the software industry adhere to the KISS rule? I did a deb install and from what I can tell have the following config files to choose from: htppd.conf - appears to be just a legacy file. apache2.conf - 1.) I can't find any reference to DocumentRoot. 2.) The only reference to VirtualHost is at the very end of the file which refers to: Include /etc/apache2/sites-enabled/[^.#]* /etc/apache2/sites-enabled/ containes one file: 000-default This file is obviously a virtual host configuration file, but apart from configure the file W.T.H. do I do with it? Do I rename it to match the Vhost name? Do I create one file for each Vhost? This file still doesn't match the example that I found in the docs(the second code block). There is more config choices than I need or want, you should be able to just set the DocumentRoot and ServerName and leave all of the other configurations global, correct? |
what editor are you using? try using something like pico or nano. You can search for the pattern DocumentRoot. It's there somewhere.
|
[[KISS]] only really goes so far. At this level, KISS just leaves you with a simple and stupid application. That's not exactly what is required from a web server now is it?
ok so this is on debian, which i've never used... so the virtual hosts are in that sites-enabled directory... so you'd presumably wnat to create another file in there for your domain, and inside that, you'll be free to change the DocumentRoot anyway. You should be able to chaneg it globally in the main apache2.conf, but it'll be outwardly identical whichever way you did it. |
I meant KISS in respect to the documentation for apache, or any other software(linux) for that matter.
The docs for apache are not anywhere near approaching KISS. Actually it isn't even accurate, or at lease it is contradictory. For example, the docs state that The main configuration file is usually called httpd.conf, yet the file states: This is here for backwards compatibility reasons and to support installing 3rd party modules directly via apxs2, rather than through the /etc/apache2/mods-{available,enabled} mechanism. Helpful, NO in both cases. Quote:
Code:
# Include the virtual host configurations: The 000-default file is a virtual host configuration file with an extensive amount of configuration options. Do I config a copy of this file for each virtual host that I want to set up? What do I name it, 001--vhostnameA & 002--vhostnameB ? What about the example from the docs: Code:
<VirtualHost *:8088> There is also a second directory called /etc/apache2/sites-available/ that contains a file: "default" which appears to be identical to /etc/apache2/sites-enabled/000-default. What is this for? Thanks, Brad |
well this is just a difference in scope for apache / distros. you're presumably reading official apache documentation, which is wholly accurate when related to the official apache source, however is a distro takes it upon themselves to try tosplit up the configuration for reasons they feel they can justify, that's not apaches fault.
But anyway. For your virtual host, a file containing nothing but one of the examples above, e.g: Code:
<VirtualHost *> |
why don't you just create your own apache2.conf or httpd.conf and put what you want? Just make sure your script points to the right conf file on startup.
|
well i wouldn't recommend starting from scratch... but in a similar vein you could actually just tag anything at all that you want onto the end of apache2.conf anyway, the individual files are not needed as such.
|
so I could just replace:
Include /etc/apache2/sites-enabled/[^.#]* in apache2.conf with: <VirtualHost *:8088> DocumentRoot /www/example1 ServerName www.example1.no-ip.com </VirtualHost> <VirtualHost *:8088> DocumentRoot /www/example2 ServerName www.example2.no-ip.com # Other directives here </VirtualHost> As I haven't mentioned, but should be obvious I am a newbie. |
yes, but remember that that does go against the design methods being used within the distro. also you preumably wouldn't want to be using port 8088 etc.....
|
Just above the virtual hosts section is a line that says
#NameVirtualHost *:80 If you uncomment it you can use the name based virtual hosts and below that you can just start adding virtualhost sections for each domain you want to host. |
Actually mine comes already uncommented and there is also no servername variable in the file like in the docs.
Code:
NameVirtualHost * I am having problems getting the virtual sites up and responding and was wondering about that and assumed that the ports.conf file maintain the setting for the server? I did want port 8088 because I am running this at home and port 80 is blocked, plus no ... |
The files are here , to give you a better idea.
Also, how can I execute a local request for a local virtual site? Doesn't the request have to include the site name, otherwise it will go to the default site? |
Also could I simply strip out my current files (config) and replace them with the "OEM" ones?
|
All times are GMT -5. The time now is 04:54 AM. |