Connecting to multiple site in one server/ip, does port being used related?

37 Views Asked by At

This problem is related to Host Multiple Domains on One Server/IP

I firstly did the CI project in my localhost.

As such, there are some issues I encountered when connecting server-local, referred at What is the possible setting for Codeigniter connecting to a SSH server with centOS and mariadb as database management?

sudo iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

This command solved it. Opening port 3306.

Just opening port through the firewall, this solution solved the problem connecting my localhost to database server, I can access now the CI project.

Now my problem is I cannot access the CI when I deployed it at the same server/ip together with another project(phpList).

ADDED NOTE: as mentioned at the comments below.(Sorry for this late confirmation) There is no available DNS, so the applied servername,etc could be denied, that means I could only use server-ip address.

My question is, do I need to also setup the port in the vhost in my CI project same as to what port opened in my localhost-server problem?

The phplist vhost setting is:

<VirtualHost *:80>
    ServerName phplist.example.com
    ServerAdmin [email protected]
    DocumentRoot /var/www/phplist-3.0.5/public_html

    LogLevel warn
    ErrorLog /var/log/httpd/phplist_error.log
    CustomLog /var/log/httpd/phplist_access.log combined
</VirtualHost>

In my CI project, this is the vhost:

<VirtualHost *:81>
    ServerName listcsv.com
    ServerAdmin [email protected]
    DocumentRoot /var/www/citest/

        <Directory /var/www/citest>
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

I tried changing <VirtualHost *:81> into <VirtualHost *:3306> but I still failed on accessing.

Could I be missing some other settings for this? Could there be possible work-around? I'm in desperate need of help.

UPDATES:

So I tried adding another port to listen, in httpd.conf:

Listen 80
Listen 81

Tried to open http://123.123.123.123:81, there are no errors thrown but it seems to load very long.

0

There are 0 best solutions below