I have a raq4 with cobalt 6 on it but I can't find anywhere where I can change the port number for a virtual site. I can assign an ip address to a virtual site but not a port number. Are all the raq4 virtual sites hardwired on port 80? Can a port number be changed by telnet command? thanks for any advice.
Titox
09-13-2009, 05:25 PM
In a Strongbolt installation, you can edit the files of folder /etc/httpd/conf/vhosts.
You must see something like that:
<VirtualHost 192.168.1.200:80>
ServerName pepito.pepe.com
ServerAdmin admin
...
Obviously the last number of the first line is the port number. I didn't tried before but may be editing this file works.
I don't have any CobaltOS server running today but tommorrow I'll be able to check if you want.
Alberto.
I'm not using strongbolt so if you know the solution for cobalt 6 that'd be great, thanks.
Titox
09-14-2009, 03:49 PM
In the CobaltOS the virtual server definitions are at the end of httpd.conf. And it's located in /etc/httpd/conf/.
The port definition is the same as the newer Apache configurations. Maybe is necessary to stop the Apache webserver before do any change:
# /etc/rc.d/init.d/httpd stop
edit now httpd.conf
# /etc/rc.d/init.d/httpd start
Let me now if this works.
Alberto.
thanks for your further feedback. At the end of my httpd.conf file I found the site and it looked like this:
*****************************************************************
httpd.conf [-M--] 0:453+47=500/500 - *17511/17511b= -1
ServerName www.mydomain.com
ServerAdmin admin
DocumentRoot /home/sites/site2/web
RewriteEngine on
RewriteCond %{HTTP_HOST} !^172.16.1.36(:80)?$
RewriteCond %{HTTP_HOST} !^www.mydomain.com(:80)?$
RewriteRule ^/(.*) http://www.mydomain.com/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site2/users/$1/web/$3
I changed 172.16.1.36(:80) to 172.16.1.37(:5000) and www.mydomain.com(:80) to www.mydomain.com(:5000) but it hasn't worked. I did the httpd start stop thing before and after the edit too. I've also forwarded the new port (5000) to the new ip address in the router.
I've watched the raq's web traffic closely and the request is actually getting to the correct ip address in the raq but the raq is not giving the page. I have a feeling I'm part way there but there's still something else that might need editing to make this port change work.
perhaps if it can't be done I'll just have to shell out and get strongbolt.
Titox
09-23-2009, 05:03 PM
It works!
Continuing with our little investigation, I powerd up a RaQ 4 today. It has many of the Zeffie's updates.
Taking a look in the Apache 1.3 manual I found we need to add this line:
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the VirtualHost command
Listen 80
Listen 5000
I've attached the httpd.conf file. Today I only can test it locally (accessing with http://192.168.2.102:5000/) but nothing makes me think it doesn't work from outside my network.
my virtualsite is configured in this way:
<VirtualHost 192.168.2.102:5000>
ServerName test5000.titox-net.es
ServerAdmin admin
DocumentRoot /home/sites/site1/web
RewriteEngine on
RewriteCond %{HTTP_HOST} !^192.168.2.102(:5000)?$
RewriteCond %{HTTP_HOST} !^test5000.titox-net.es(:5000)?$
RewriteRule ^/(.*) http://test5000.titox-net.es/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site1/users/$1/web/$3
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php
</VirtualHost>
Cheers,
Alberto.
thanks for your further feedback. I did the extra amendments you gave but now instead of getting the web site (mydomain.com) at 172.16.1.37 I'm getting the raq admin login page. The real raq admin login page has always been a different ip address. I think the Listen 5000 entry caused this. I then put all the httpd.conf settings back as they were but I'm still getting the raq admin login page now but I shouldn't be. I think I've messed it up.
Titox
09-24-2009, 03:24 PM
Oug! My site is working well with this configuration. I modified the DNS of the domain and tested if from outside, it works. Now I only have the welcome page, but I can access the server and administer it. From outside I can see both main and modified site.
My port changed site is the second virtual site of the server, not the main one. Another thing: Modifiying the httpd.conf file I did a mistake and the Apache didn't want to start. What message you get if you restart the Apache server?
# /etc/rc.d/init.d/httpd restart
Alberto.
I don't get any error message when restarting apache. It stops and restarts fine after I edit httpd.conf. To put things right again I completely deleted the virtual site I was messing with and created a new one. Now everything works again as it should.
I don't know why the port forward thing doesn't work for me. Changing the port either doesn't give anything, or it gives the wrong location.