Very newbie Apache question
Heya!
I know its simple but I m stuck. I m a bit confused about Locations, Virtual Servers and Directories in Apache 2.0 How do I make it so by opening http://mycomputer/page/ on my computer /usr/azhrarn/stuff/page.htm opens? I have apache working, I just need the link Also, page.htm cannot be moved. Thanks a million! Cheers Azhrarn |
To access /usr/azhrarn/stuff/page.htm, find your httpd.conf in /usr/local/apache2/conf/httpd.conf. Change your document root by editing the file.
First, you will want to change what says after "DocumentRoot." In my case, it's on line 104. It should be at least somewhere around there for yours. If not, try doing a pattern search. Anyway, substitute Code:
DocumentRoot "<default_document_root>" Code:
DocumentRoot "/usr/azhrarn/stuff" Code:
<Directory "<default_document_root>"> Code:
<Directory "/usr/azhrarn/stuff"> Code:
DirectoryIndex page.htm Now, you should be ready. If you set you DirectoryIndex to page.htm, entering http://localhost/ in your browser should do the trick. If not, http://localhost/page.htm will do the same thing. Also, make sure apache is running: Code:
$ sudo apachectl start |
Thanks a mil, works like a dream.
Just one more question however, how would I come about configuring it if I wanted it to be accessed using http://server/page/page.html (subdirectory) rather than http://server/page.html (default) Thanks!! Azh |
Make another directory called "page" under your DocumentRoot and change that path in httpd.conf as well. You also would need to add "page.html" in your directory index.
I would suggest reading up on apache and how it works on google. You will gain tons of valuable information on one of the best webservers out there. -twantrd |
All times are GMT -5. The time now is 07:11 AM. |