LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Webmin & Apache: Can't get rid of start page! (https://www.linuxquestions.org/questions/linux-newbie-8/webmin-and-apache-cant-get-rid-of-start-page-253089/)

RavenLX 11-09-2004 11:47 PM

Webmin & Apache: Can't get rid of start page!
 
I'm having a very hard time trying to configure apache. I've been trying to understand incomprehensible "official" and other documentation including FAQs for the past 8 hours and got nowhere. :( I am pressed for time as I need to get a server running so I can test scripts on my and write stuff on my own machine for some work I need done fast.

Here's what I need to do:

Keep in mind I'm trying to use webmin to set up apache.

1. Set up apache to use a root directory like /home/users/test for example (it could be any directory, even on a windows partition, actually). And then if I go to http://127.0.0.1 or http://localhost, then the index.html in /home/users/test (for example) would be displayed.

2. I need php and perl (CGI) to work from files located in say, /home/users/test/cgi-bin

Help would be GREATLY appreciated.

linux_terror 11-10-2004 12:27 AM

your default webroot is /var/www/html , so to add content and get rid of the test page
Code:


cd /var/www/html

remove everything in the directory except the addon-modules directory
then add your index.html to the /var/www/html directory. voila' your site is up
make sure your webserver is started if you get errors.
your default cgi-bin is /var/www/cgi-bin
it will resolve at http://127.0.0.1/cgi-bin/filename.cgi
note: you have to populate the cgi-bin with a script, you will get 'not found' or 'not authorized' if you try to call it as a dirctory.
PHP will run in any directory. You dont need to put it in cgi-bin.
If you need a more complex setup such as virtualhosts then post again.

Hope this helps
linux_terror

RavenLX 11-10-2004 12:46 AM

Access denied if I try to add a directory or file to that /var/www/html folder where I found the file you mentioned. I NEED it to be another folder because I already have files there that I want to share between windows and linux not have one folder for linux and one for windows. This way I don't have to go copying files around on the hard drive from linux to windows and forget if I updated one side or not.

linux_terror 11-10-2004 01:28 AM

1.) access denied = you need to be root or the user that owns the direcory.
2.) if you want to change the directory apache serves by default change this line in /etc/httpd/conf/httpd2.conf

DocumentRoot "/var/www/html"

change the path to wherever you want it to go and make sure apache has rights to it. usually a chmod 755 will be fine to allow apache access.

linux_terror

RavenLX 11-10-2004 03:00 PM

Quote:

Originally posted by linux_terror
1.) access denied = you need to be root or the user that owns the direcory.
I don't work on my linux side of things as root. I work as a user. So I have to be able to easily make my directories and files, and save them without being root. Thus why I need another directory.

Quote:

Originally posted by linux_terror

2.) if you want to change the directory apache serves by default change this line in /etc/httpd/conf/httpd2.conf

DocumentRoot "/var/www/html"

change the path to wherever you want it to go and make sure apache has rights to it. usually a chmod 755 will be fine to allow apache access.

Ok, that worked. I also set up my CGI dir using the <directory> thing. But I had to still use a dir on the linux side. I could not set permissions of a dir on the windows partition. I forgot about this. Oh well, for now at least the basics are up enough that I can get some things done.

Thanks for the help - I don't think I could have set this up if it weren't for your tips. :)

linux_terror 11-10-2004 04:32 PM

there are two ways to achieve what you want as far as permissions...

1.) when working as a non-priveleged user open a terminal and type su (this is the superuser command) it will ask you for your root password, enter it, you are now root in that terminal and can do what you need to.

2.)you can also do this--> as root... chown -R username:groupname /path/to/your/specified/webroot to the user and group that you would like to have doing the web administration this will allow that user to edit/save files to the directory and as long as its 755 apache should be able to still serve it up.

oh...and the windows partition dealie... try doing this

Code:

umount /path/to/mountpoint
or
umount /dev/devicename

then change the permissions of the mountpoint while it is unmounted, after changing the permissions of the mount point mount the device again. Should work now.
NOTE:you will probably need to be root to edit the permissions.

glad you a least got the basics runnin, hopefully this will tie the rest together :D

linux_terror

RavenLX 11-10-2004 11:04 PM

Thanks. :) Good info for most newbies. I already knew about permissions, etc. I guess what I was saying was I don't want to have to bother being root to do everything. I want to do everything from my user account.

The permission of the mountpoint is fine. It's the directories IN there that can't be displayed on the browser even if the directory was set in Apache. I'm thinking maybe it might need share permissions on the Windows side. I might try that next.


All times are GMT -5. The time now is 11:25 PM.