0

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 admin@example.com
    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 admin@listcsv.com
    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.

andil01
  • 377
  • 4
  • 19
  • Use `:80` in both VirtualHosts, make sure both `listcsv.com` and `hplist.example.com` point to the same (correct) IP address. From browser, use names (not address) to access. If it still fails, provide the exact error message. – Dusan Bajic Nov 17 '17 at 08:07
  • @DusanBajic changed both to `:80`, tried to access `listcsv.com` and `phplist.example.com`. It fails, both gives me error of: `This site can’t be reached listcsv.com’s server DNS address could not be found. Did you mean http://listcv.com/? Search Google for list csv ERR_NAME_NOT_RESOLVED` and `This site can’t be reached phplist.example.com’s server DNS address could not be found. Go to http://example.com/ Search Google for phplist example ERR_NAME_NOT_RESOLVED` – andil01 Nov 17 '17 at 08:14
  • Did you "make sure both listcsv.com and hplist.example.com point to the same (correct) IP address"? – Dusan Bajic Nov 17 '17 at 08:16
  • @DusanBajic does `*:80` not specify it? do I make it like `123.123.123.123:80`? – andil01 Nov 17 '17 at 08:19
  • @DusanBajic tried it. Still the same. – andil01 Nov 17 '17 at 08:21
  • No no no. Your client (browser) needs to know how to resolve `phplist.example.com` to the correct server IP address. [DNS](https://en.wikipedia.org/wiki/Domain_Name_System) is usually used for this, but you san also hardcode it in your workstation [hosts](https://en.wikipedia.org/wiki/Hosts_(file)) file – Dusan Bajic Nov 17 '17 at 08:29
  • @DusanBajic Ah, I get now what you explained. I will try again. I will update if anything happens – andil01 Nov 17 '17 at 08:36
  • @DusanBajic sorry I just confirmed this from someone. there's no bought dns by this server. So I could use only ip-addresses. Sorry for bothering. – andil01 Nov 17 '17 at 09:05

0 Answers0