LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-09-2004, 11:47 PM   #1
RavenLX
Member
 
Registered: Oct 2004
Posts: 98

Rep: Reputation: 15
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.
 
Old 11-10-2004, 12:27 AM   #2
linux_terror
Member
 
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
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
 
Old 11-10-2004, 12:46 AM   #3
RavenLX
Member
 
Registered: Oct 2004
Posts: 98

Original Poster
Rep: Reputation: 15
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.
 
Old 11-10-2004, 01:28 AM   #4
linux_terror
Member
 
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
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
 
Old 11-10-2004, 03:00 PM   #5
RavenLX
Member
 
Registered: Oct 2004
Posts: 98

Original Poster
Rep: Reputation: 15
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.
 
Old 11-10-2004, 04:32 PM   #6
linux_terror
Member
 
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
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

linux_terror

Last edited by linux_terror; 11-10-2004 at 04:37 PM.
 
Old 11-10-2004, 11:04 PM   #7
RavenLX
Member
 
Registered: Oct 2004
Posts: 98

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I cant change the default test page in apache server to add my page.y nhemapriya Linux - Newbie 3 05-13-2004 12:35 PM
Webmin & Apache error LordChaos Linux - Software 3 11-20-2003 10:37 PM
Webmin, Mandrake 9.0 - Apache won't start. vadertech Linux - General 4 08-19-2003 02:53 PM
Webmin & apache automicro Linux - Software 2 08-10-2003 07:25 PM
Cannot Start Apache Through Webmin John_Saunders Linux - Software 2 06-10-2002 10:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration