LinuxQuestions.org
Review your favorite Linux distribution.
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 10-12-2003, 08:41 PM   #1
firefightin4fun
LQ Newbie
 
Registered: Sep 2003
Posts: 21

Rep: Reputation: 15
Web server


Hey all, I just set up apache so that i can get the test page using (/etc/init.d/httpd start). Okay now how do i change that file so i can start posting what i want. I have some basic html commands background but I'm not sure where to go with this one at all. Any suggestions?
 
Old 10-12-2003, 08:56 PM   #2
r3ekon
LQ Newbie
 
Registered: Oct 2003
Location: Northwood - Ohio
Distribution: Red Hat 9
Posts: 11

Rep: Reputation: 0
Angry Cha Cha

In your httpd.conf file you can specify the options that suit you. One of the main ones your looking for is RootDirectory ..

Change that to the directory of your html files =)

Now I will post my problem so I dont have to make another topic...

My situation:

1 Server running HTTPD, BIND, ProFTPD, etc...
The server is under a router, all ports needed are forwarded.
Static Public IP Address, with internal IP of 192.168.0.2

I am being told to use NameVirtualHost *
... but when I do so I get the following error..

Code:
[Sun Oct 12 20:44:05 2003] [error] VirtualHost _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Oct 12 20:44:05 2003] [warn] NameVirtualHost *:0 has no VirtualHosts
So what I went ahead and did was make it NameVirtualHost *:80

This is how I have my VirtualHosts setup...

<VirtualHost *>
ServerName pctechcentral.com
DocumentRoot /home/pctechcentral
</VirtualHost>

<VirtualHost *>
ServerName anti-noob.net
DocumentRoot /home/shadow
</VirtualHost>

Now what happens is it loads the httpd.conf with no errors, but pctechcentra.com goes to the anti-noob.net, and same for anti-noob.net

What am I doing wrong, or please let me know if you need more info...
 
Old 10-12-2003, 11:49 PM   #3
teknomage1
LQ Newbie
 
Registered: Aug 2003
Posts: 17

Rep: Reputation: 0
I think your virtual host entries need to have a unique name in the definition rather than just *. Also check and see if your httpd.conf has been split into multiple files and if it has make sure there isn't conflicting info in one of the other files
 
Old 10-13-2003, 12:34 AM   #4
firefightin4fun
LQ Newbie
 
Registered: Sep 2003
Posts: 21

Original Poster
Rep: Reputation: 15
Where can i change those options in the httpd.conf file? is it in the properties? and im not sure what you mean when you say change it to the directory of the html's. That directory is /etc/httpd/conf/http.conf. So im not really sure what i'm changing. Sorry i suck at this Linux thing
 
Old 10-13-2003, 01:29 AM   #5
r3ekon
LQ Newbie
 
Registered: Oct 2003
Location: Northwood - Ohio
Distribution: Red Hat 9
Posts: 11

Rep: Reputation: 0
Somewhere along the line I screwed my httpd.conf up, and it was being stupid...So I just reinstalled apache and used redhat-config-ttpd to add virtual hosts and it works.. Thanks for your reply..

Ok Back to you firefightin4fun...You need to open httpd.conf, and scroll thru it and set the settings to fit your situation. To set where you want it to load html files from you need to find the line that says "DocumentRoot /var/www" I think...And change it to

DocumentRoot PATHTOYOUR/HTML/FILES

Also if your using a distribution like redhat...They have an httpd editor available, and Its pretty simple. Sorry if this still don't help, I'm kind of new to this stuff...but I got it workin so I must be doin somethin right =)
 
Old 10-13-2003, 10:43 PM   #6
firefightin4fun
LQ Newbie
 
Registered: Sep 2003
Posts: 21

Original Poster
Rep: Reputation: 15
I found where it says document root /var/www and i opened it in office.org and changed it to /var/www/html(my new folder) and still nothing. Should i just install apache for windows and say goodbye to linux? LOL
 
Old 10-13-2003, 10:58 PM   #7
coldy
Member
 
Registered: Nov 2002
Distribution: Debian GNU/Linux, Gentoo
Posts: 75

Rep: Reputation: 15
so when you change anything in any conf file, to apply changes you must restart the service. In RedHat that's the command service When you make all changes in your httpd config file, type in your root console
Code:
service httpd restart
and it will print on the screen that the service is stopped and started

that's all

remember that you need to restart the service, before any changes goes true
 
Old 10-13-2003, 11:03 PM   #8
r3ekon
LQ Newbie
 
Registered: Oct 2003
Location: Northwood - Ohio
Distribution: Red Hat 9
Posts: 11

Rep: Reputation: 0
I wouldn't give up on Linux.. I did 3 times, and every time I would get back onto Windows I would be disappointed. But coldy is correcto...restart it so it will reload the config..
 
Old 10-13-2003, 11:17 PM   #9
firefightin4fun
LQ Newbie
 
Registered: Sep 2003
Posts: 21

Original Poster
Rep: Reputation: 15
thanks guys it finally worked. Something simple like that would have taken me a week to figure out. There was no documentation letting me know i needed to do that...now i have other issues to work b/c i get to see this
Forbidden

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


AT least its a step up from the test page
 
Old 10-14-2003, 01:03 AM   #10
r3ekon
LQ Newbie
 
Registered: Oct 2003
Location: Northwood - Ohio
Distribution: Red Hat 9
Posts: 11

Rep: Reputation: 0
Uhm... My guess is that its a 403 denying to give you a directory listing? What if you try to access a file directly thats in your rootdirectory?

Example....

/var/www/html/index.htm


Access http://localhost/index.htm

If that works then your Apache isn't allowing directory listing...another setting in the httpd.conf. Don't quote me on this stuff, Im goin off the top of my head at 1 am...Hope it helps though
 
Old 10-14-2003, 04:51 PM   #11
firefightin4fun
LQ Newbie
 
Registered: Sep 2003
Posts: 21

Original Poster
Rep: Reputation: 15
Okay i moved the folder and changed all the settings in the httpd.conf file.(/var/www/httpd)
I then moved the index from /var/www/html/usage into that folder and started messing around with the html . Now at least i am seeing changes to the web page but is this the right way? Is there only one folder in there where the work is supposed to be done? When i made a test html page(web.html) without having the index in there the usual apache test page came up. So after i copied the index over i can make changes to that which i can see on the page. I mean its working so i am playing around with it but what is the RIGHT way to do it..lol
 
Old 10-14-2003, 09:40 PM   #12
r3ekon
LQ Newbie
 
Registered: Oct 2003
Location: Northwood - Ohio
Distribution: Red Hat 9
Posts: 11

Rep: Reputation: 0
I don't really think their is an absolute specific way to set it up. So long as it works, and is secure then its setup the way its supposed to be. As far as the Test Page, I still cant get mine to go away unless I put an index file in my directory. Maybe someone would like to share the directive to allow directory listing? =)
 
Old 11-15-2003, 08:01 PM   #13
firefightin4fun
LQ Newbie
 
Registered: Sep 2003
Posts: 21

Original Poster
Rep: Reputation: 15
r3ekon,
Well i gave up on linux for a while, went back to windows and learned a litttle more about websites/hosting and html. Now i'm back again to give this linux thing a try. EVerytime i give up on it for a while when the urge comes back, its stronger and i feel like i just understand so much more. thanks for the help bro
 
  


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
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 11:30 PM
can we configure a Linux server with mail server,file server and web server kumarx Linux - Newbie 5 09-09-2004 07:21 AM
adding more web servers to make web server farm linuxboy69 Linux - Networking 5 07-09-2004 10:50 AM
setting up password protected web forms on an apache web server AZDAVE Linux - Security 3 07-07-2004 01:03 PM
Can't access Linux web server web pages from LAN client jaydave Linux - Networking 4 03-16-2003 03:38 AM


All times are GMT -5. The time now is 03:59 PM.

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