-2

I bought a VPS Host that gave me only 1 IP Address which I used on my first domain name and it works without any problems.

Now my second domain name I can't use the same ip address as it points to the first domain name.

So I figured my only option was to use a GoDaddy hosted iframe redirection which redirects to a sub folder on my first domain which worked so far.

Now I'm trying to load paypal from <?php headers() ?> and I get a permission error because of that iframe

Refused to display 'https://www.paypal.com/cgi-bin/webscr?notify_url=&cmd=_cart&upload=1&business=removed&address_override=1' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

How do I avoid the Iframe solution for my second domain while not messing up my first domain?

Somebody I forgot once told me it doesn't matter if you have 1 IP Address you could host multiple websites on it? how it that possible the DNS doesn't seem to work off ports afaik, yes I could host multiple websites on different folders but that's not what I call hosting a real website it has to be pointed by a domain name, so this iframe issue doesn't happen

My server configuration is httpd (apache) that comes with CentOS 6 (Linux) operating system

SSpoke
  • 161

1 Answers1

2

edit /etc/httpd/conf/httpd.conf, make sure you have "Listen 80" and "NameVirtualHost *:80" in it and add your vhosts. For example:

<VirtualHost *:80>
     ServerAdmin webmaster@example.com
     DocumentRoot /var/www/example.com/public_html
     ServerName www.example.com
     ServerAlias example.com
     ErrorLog /var/www/example.com/error.log
     CustomLog /var/www/example.com/access.log common
</VirtualHost>

<VirtualHost *:80>
     ServerAdmin webmaster@site2.com
     DocumentRoot /var/www/site2.com/public_html
     ServerName www.site2.com
     ServerAlias site2.com
     ErrorLog /var/www/site2.com/error.log
     CustomLog /var/www/site2.com/access.log common
 </VirtualHost>

<VirtualHost ipaddress:443>
     ServerAdmin webmaster@site2.com
     DocumentRoot /var/www/site2.com/public_html
     ServerName www.site2.com
     ServerAlias site2.com
     ErrorLog /var/www/site2.com/sslerror.log
     CustomLog /var/www/site2.com/sslrequests.log

     SSLProxyEngine on
     SSLEngine on
     SSLCertificateFile /etc/ssl/certs/server.crt
     SSLCertificateKeyFile /etc/ssl/private/server.key
</VirtualHost>

So under your /var/www/ you should have 2 folders example.com and site2.com which are owned by your http deamon.

You better do some research on how to use vhosts as this is a very basic question which doesn't belong here.

Basil
  • 8,931
timmeyh
  • 958