LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   virtual hosts... (https://www.linuxquestions.org/questions/linux-newbie-8/virtual-hosts-161877/)

Digital_Err0r 03-24-2004 01:16 PM

virtual hosts...
 
ive been messing around with virtual hosts for about an hour now, and was wondering, my domain is http://foxy.sytes.net, but can i do virtual hosts like, http://foxy.sytes.net/host1/ etc? ive been trying but cant figure it :| ,

thanks

digital

Digital_Err0r 03-24-2004 01:47 PM

meh, ive added a virtual host, put 'public_html' in the /etc/skel/ folder. then made a new user, and put the ftp chroot on. the ftp is working. but whenever i go to access http://foxy.sytes.net i get '400 bad request', and the same for http://foxy.sytes.net/~acigolf/

why am i getting bad request?

EDIT -- this is my virtual host in the httpd.conf file:

Code:

NameVirtualHost *
<VirtualHost *>
ServerAdmin blah@email.com
DocumentRoot /home/acigolf/public_html
ServerName acigolf.foxy.sytes.net
ErrorLog /home/acigolf-error.log
CustomLog /home/acigolf-access.log common
</VirtualHost>

EDIT -- and i still get bad request on http://foxy.sytes.net ( the default )

thanks

Digital_Err0r 03-24-2004 03:22 PM

bump

tuxguy 03-24-2004 03:37 PM

Is that subdomain setup at no-ip.com?
acigolf.foxy.sytes.net

plus you have an ssl apache. listening on port 443.. when you type in foxy.sytes.net - the browser assumes you are trying http not https.. this is why you are getting the bad error.
but when you type in https://foxy.sytes.net is give the cannot find server error..??
in your httpd.conf file in the ssl section, you have to enable ssl for virtual servers as well.

Digital_Err0r 03-24-2004 03:44 PM

nevemind the subdomain, im just gona use http://foxy.sytes.net/~acigolf/ , anyway i cant find anything about ssl with virtual hosts in the httpd.conf . i just get the bad request through http://foxy.sytes.net . the ftp accounts work fine though~ what should i do about the enabling ssl for virtual hosts ?

thanks

Digital_Err0r 03-24-2004 04:03 PM

meh i just ran 'httpd' in the terminal and i get:

Code:

[root@localhost root]# httpd
[Wed Mar 24 22:01:47 2004] [error] VirtualHost _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with
undefined results
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down

how can i fix that, because thats my problem....

Digital_Err0r 03-24-2004 04:33 PM

bump

tuxguy 03-24-2004 07:00 PM

what does your httpd.conf file say about listen? if you want try this...

NameVirtualServer *:80
blah blah....

Digital_Err0r 03-25-2004 01:35 AM

hmm i just have

NameVirtualHost *

etc etc....

continuing with the virtual hosts...

should i put

NameVirtualServer *:80

in aswell?

tuxguy 03-25-2004 06:28 AM

if your apache is listening on both ports I would say yes give it a shot, cauze your server is listening on port 80. But it's an ssl server (which is port 443)
So just add the port to your NameVirtualHost

Let me know how it goes...

Digital_Err0r 03-25-2004 10:07 AM

umm i tried

NameVirtualServer *:80 which apparently isnt even a function according to my apache, and when i set the

NameVirtualHost *

to

NameVirtualHost *:80

i cant access any of the subdirs in the home dir by doing http://foxy.sytes.net/~foxy/

just says cannot find

Digital_Err0r 03-25-2004 10:41 AM

rite. this is whats happing at the mo.

in my /home/ dir i have

foxy/
default_user/
acigolf/

so i set the default root for apache to

/home/default_user/public_html/

it loads fine.

i then created two virtual hosts in the httpd.conf file:

Code:


NameVitrualHost *

<VirtualHost *>
ServerName foxy
DocumentRoot /home/foxy/public_html/
ServerAdmin you@blah.com
CustomLog /home/logs/foxy-access.log combined
ErrorLog /home/logs/foxy-error.log
</VirtualHost>

<VirtualHost *>
ServerName acigolf
DocumentRoot /home/acigolf/public_html/
ServerAdmin you@blah.com
CustomLog /home/logs/acigolf-access.log combined
ErrorLog /home/logs/acigolf-error.log
</VirtualHost>

stopped apache and started it seperately. when i try to access http://foxy.sytes.net/~acigolf/ or http://foxy.sytes.net/~foxy/ i get nothing.

what should i be doing to get these to work with virtual hosts and the /~name/ ?

thanks

EDIT --

when i type 'httpd' into the terminal like before i still get

Code:

httpd failed. The error was: Starting httpd: [Thu Mar 25 16:49:46 2004] [error] VirtualHost _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
[FAILED]

EDIT EDIT EDIT EDIT EDIT

i cant even start httpd in serivces now i keep getting that error :scratch:

Digital_Err0r 03-25-2004 11:57 AM

seeing that i cant even start httpd now, here is my conf file...

http://www.gta-central.com/httpd.conf.txt

tuxguy 03-25-2004 11:58 AM

do you really need SSL? if not dont use it... and your are running apache with the ssl mod enabled.. but the default ssl port (443) is no where in your httpd.conf file. Have you made your certificate/key for SSL? I recommend you get http://apache.mirror.secondchapter.i...-2.0.49.tar.gz and build the server without SSL. (if you dont need it.) If you do here is the apache how-to for 2.0 http://httpd.apache.org/docs-2.0/


for the httpd.conf file to acces the public_html files the module has to be in..

Code:

<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir "enable" remove comment (#) on this line, and change disable ro enable

    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, use this directive instead of "UserDir disable":
    #
    UserDir public_html

</IfModule>


Digital_Err0r 03-25-2004 12:02 PM

i dont use ssl, how can i get rid?

edit -- i installed it incase of fututre use with php... it must be possible for it to work with virtual hosts and that.

i cant even get httpd running anymore :(


All times are GMT -5. The time now is 02:29 PM.