LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-17-2003, 07:07 PM   #1
artistik
Member
 
Registered: Aug 2003
Location: south carolina
Distribution: Slackware 11
Posts: 60

Rep: Reputation: 15
Talking webmin/apache


i have a problem...im on slackware 9 using webmin 1.100...but heres the problem..im trying to setup a virtual server so when sombody browses my site...example: something.mydomain.com it takes them to whatever i got the document root set to..but i cant get rid of the default for sum reason...if anybody can tell me how to get rid of the default virtual server i would really appreciate it...the default looks like this..therefore any address i put on my box...it auto takes em to the default virtual server which i dont want...

Address Any
Port Any
Server Name myservername
Document Root /home/artistik/public_html/

i need to find a way to delete this offa webmin but it wont let me...
 
Old 08-17-2003, 11:58 PM   #2
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 30
Re: webmin/apache

Quote:
Originally posted by artistik
i need to find a way to delete this offa webmin but it wont let me...
What you should do if you're unhappy with what webmin does, is edit your /etc/apache/httpd.conf by hand, remove these entries, and put in your documentroot or whatever as you want.
 
Old 08-18-2003, 01:35 PM   #3
artistik
Member
 
Registered: Aug 2003
Location: south carolina
Distribution: Slackware 11
Posts: 60

Original Poster
Rep: Reputation: 15
well i did do that...i want so when ppl browse my web adress it takes em to what the document root says....but when i setup a virual server ie: something.mydomain.com and i got that set to a diff documentroot it still goes to the main document root...because webmin has the default virtual server set to any address...and i cant find a way to delete the default server on webmin =p
 
Old 08-18-2003, 06:42 PM   #4
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 30
can you post the relevant sections of your httpd.conf please? or at least a link to it...
 
Old 08-18-2003, 09:22 PM   #5
artistik
Member
 
Registered: Aug 2003
Location: south carolina
Distribution: Slackware 11
Posts: 60

Original Poster
Rep: Reputation: 15
www.d0hp.org/httpd.conf try that..
 
Old 08-19-2003, 04:17 AM   #6
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 30
I'm not entirely sure what you want to do. Do you want to make it so that when they access your webserver, they get directed to /home/trin/public_html? If so, then replace all of the /home/artistik/public_html entries with /home/trin/public_html, and restart the apache web server:
apachectl restart
Or are you trying to do something else?
 
Old 08-19-2003, 04:28 AM   #7
artistik
Member
 
Registered: Aug 2003
Location: south carolina
Distribution: Slackware 11
Posts: 60

Original Poster
Rep: Reputation: 15
im trying to make it so when they try to access like web.d0hp.org or any other address i have up...it takes them to some other directory besides /home/artistik/public_html but i still wanna leave www.d0hp.org up...as the /home/artistik/public_html
 
Old 08-19-2003, 04:33 AM   #8
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 30
Okay,several things here.
When you create virtualhosts, you *must* create one first for your default document root, a <VirtualHost> directive for that is a must. That's the main thing, and probably the main problem.
Secondly, I belive that in the virtualhost specification, you need to specify the servername directive.

I hope this helps, the first part is the most important. I haven't done any virtualhosting based on domain name, only on port number, which is slightly different, but I hope the above information is correct
 
Old 08-19-2003, 07:26 AM   #9
Cooner
Member
 
Registered: Jul 2003
Location: Hastings, MN. USA
Distribution: Ubuntu 10.xx
Posts: 109

Rep: Reputation: 15
Here is an example of what works for me

NameVirtualHost 192.168.1.16

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
<VirtualHost 192.168.1.16>
UseCanonicalName off
ServerAdmin Cooner@myweb.com
DocumentRoot /var/www/html
ServerName myweb.thisweb.com #Default
ErrorLog /var/log/apache/myweb.thisweb.com-errorlog
CustomLog /var/log/apache/myweb.thisweb.com-access_log common
</VirtualHost>
<VirtualHost 192.168.1.16>
UseCanonicalName off
ServerAdmin Cooner@myweb.com
DocumentRoot /var/www/html/myweb2
ServerName myweb2.thisweb.com
ErrorLog /var/log/apache/myweb2.thisweb.com-errorlog
CustomLog /var/log/apache/myweb2.thisweb.com-access_log common
</VirtualHost>
<VirtualHost 192.168.1.16>
UseCanonicalName off
ServerAdmin Cooner@myweb.com
DocumentRoot /var/www/html/myweb3
ServerName myweb3.thisweb.com
ErrorLog /var/log/apache/myweb3.thisweb.com-error_log
CustomLog /var/log/apache/myweb3.thisweb.com-access_log common
</VirtualHost>
 
Old 08-19-2003, 02:11 PM   #10
artistik
Member
 
Registered: Aug 2003
Location: south carolina
Distribution: Slackware 11
Posts: 60

Original Poster
Rep: Reputation: 15
check this out..heres how this looks ...www.d0hp.org/snapshot4.png
 
Old 08-19-2003, 03:04 PM   #11
Electric_Blue
Member
 
Registered: Aug 2003
Distribution: RedHat
Posts: 35

Rep: Reputation: 15
Looks like you are on the right track, but I would suggest manually editing the httpd.conf file instead of using webmin.

I use <Virtualhost *> and it has always worked like a charm for me. I have no default setting.

(snip of my httpd.conf)
# Use name-based virtual hosting.
# Make sure you have this un-commented
NameVirtualHost *

<VirtualHost *>
DocumentRoot /var/www/html/
ServerName www.somedomain.com
</VirtualHost>

<VirtualHost *>
DocumentRoot /var/www/html/ftp
ServerName ftp.somedomain.com
</VirtualHost>

#<VirtualHost _default_:*>
#</VirtualHost>
(end snip)

Works for me, might give it a try. This is on 1.3.20 Apache by the way. Don't know if anything got changed in later versions.

good luck!
 
Old 08-19-2003, 03:26 PM   #12
artistik
Member
 
Registered: Aug 2003
Location: south carolina
Distribution: Slackware 11
Posts: 60

Original Poster
Rep: Reputation: 15
thanks for the tips guy....thy helped and i think it works now with Electric_Blue's last example...but it was all just a process of elimination...i do thank ya...ether of you hang on irc?

one more thing..i did chmod 665 /home/artistik/public_html/ and i keep getting Forbidden

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

any other modes to use?

Last edited by artistik; 08-19-2003 at 03:34 PM.
 
Old 08-19-2003, 05:23 PM   #13
Electric_Blue
Member
 
Registered: Aug 2003
Distribution: RedHat
Posts: 35

Rep: Reputation: 15
look and see who the owner of that directory is
apache will generally want to own everything in the directory, but it's not necessary.

If it is owned by root with 665 I don't think you will be able to get in. You will also need to do this with -R for recursive through the structure.

chmod -R 665 /home/artistik/public_html

otherwise it will only change permissions on the directory itself and not the files in it


If still no access might try
chown -R apache:apache /home/artistik/public_html

then if it still won't let you in just blow the directory (777) wide open until you figure out which one of the permissions is causing you problems.

Great job!
 
Old 08-19-2003, 06:20 PM   #14
artistik
Member
 
Registered: Aug 2003
Location: south carolina
Distribution: Slackware 11
Posts: 60

Original Poster
Rep: Reputation: 15
heh none of that is workin.. =/
 
Old 08-19-2003, 08:06 PM   #15
Electric_Blue
Member
 
Registered: Aug 2003
Distribution: RedHat
Posts: 35

Rep: Reputation: 15
ahh
i just went and tried to access your site. I see you do have it forwarding directories, BUT it looks as though your

http://www.d0hp.org/

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

Is being directed to the / directory, which indeed, no one should have access to

Look at the changes you made to the httpd.conf and make sure you didn't put a space after / or something that is causing it to try and open webpages on the uppermost level of your file system.

Looks like you are almost there.

Last edited by Electric_Blue; 08-19-2003 at 08:08 PM.
 
  


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
webmin apache 2 dienerk Suse/Novell 3 10-26-2004 07:18 AM
Webmin Through Apache using mod_proxy... ech310n Linux - General 0 01-28-2004 04:12 PM
Apache 2 and Webmin bogomip_bandit Linux - Software 1 05-21-2003 07:10 PM
webmin and apache SSBN Linux - Networking 3 05-02-2003 09:59 AM
Cannot Start Apache Through Webmin John_Saunders Linux - Software 2 06-10-2002 10:17 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration