PDA

View Full Version : [all variants] how to hide ":8080"?



vitorgatti
April 30th, 2008, 01:49 PM
How can I hide the ":8080" from the address bar?
My site is, for example, mysite.com
Then it redirects to mysite.com:8080/opencms/opencms/

Is there a way to keep mysite.com in the address bar?
Just for eye candy...

I'm using Apache and OpenCMS.

Thanks!

bluefrog
April 30th, 2008, 01:55 PM
not an apache guru but I think mod_rewrite might do that
investigate that

cdenley
April 30th, 2008, 04:10 PM
Something like this would work.



sudo a2enmod proxy
sudo a2enmod proxy_http




NameVirtualHost *
<VirtualHost *>
<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyVia On
</IfModule>
ServerName mysite.com
ProxyPass / http://127.0.0.1:8080/opencms/opencms/
ProxyPassReverse / http://127.0.0.1:8080/opencms/opencms/
</VirtualHost>

vitorgatti
April 30th, 2008, 07:14 PM
Thanks a lot for the help
I'm going to test those stuff

:)

vitorgatti
April 30th, 2008, 08:25 PM
Something like this would work.



sudo a2enmod proxy
sudo a2enmod proxy_http




NameVirtualHost *
<VirtualHost *>
<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyVia On
</IfModule>
ServerName mysite.com
ProxyPass / http://127.0.0.1:8080/opencms/opencms/
ProxyPassReverse / http://127.0.0.1:8080/opencms/opencms/
</VirtualHost>



where do I put this code?
httpd.conf?
apache.conf?

cdenley
April 30th, 2008, 08:31 PM
Backup your default vhost configuration...


cp /etc/apache2/sites-available/default ~/vhost_backup.txt


...then replace /etc/apache2/sites-available/default with the configuration I posted, then reload apache.


sudo /etc/init.d/apache2 reload

vitorgatti
April 30th, 2008, 09:04 PM
this almost worked...
worked, but now the page isn't displayed correctly
like the images links weren't linked right

I wonder why...

cdenley
April 30th, 2008, 09:45 PM
What are the URL's of the images?

http://mysite.com:8080/opencms/opencms/images/myimage.jpg
or
http://mysite.com:8080/opencms/images/myimage.jpg

How are the images referenced in your html code?


<img src="http://mysite.com:8080/opencms/opencms/images/myimage.jpg" />
or
<img src="/opencms/opencms/images/myimage.jpg" />
or
<img src="images/myimage.jpg" />