0

I have two directories in /var/www called acollida and segona. I have an index.php file in both of the directories, as well.

What’s more, in /etc/apache2/sites-available/ I have two archives:

acollida.com.conf, with:

<VirtualHost *:80>
    ServerAdmin xxx
    ServerName acollida.com
    ServerAlias www.acollida.com
    DocumentRoot /var/www/acollida
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

And a file called segona.com.conf with:

<VirtualHost *:80>
    ServerAdmin xxx
    ServerName segona.com
    ServerAlias www.segona.com
    DocumentRoot /var/www/segona    
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I've also enabled the sites with this command:

a2ensite

I’ve disabled the 000-default site as well as restarting the server.

And in /etc/hosts file I have:

127.0.0.1   localhost
127.0.1.1   ubuntu01

192.168.10.17 segona.com
192.168.10.17 acollida.com

Well, when I put aocollida.com or segona.com on the server it works, but when I use it while on another computer in the net, using the name of the server (SLTUBUNTU01) or the IP (192.168.10.17) it always shows the acollida.com site. For example:

Going to SLTUBUNTU01 or 192.168.10.17 shows acollida.com And when I put SLTUBUNTU01/acollida.com or SLTUBUNTU01/segona.com, it doesn’t work.

Does anyone know how I could solve this problem?


Ubuntu version: Ubuntu 16.04.2 LTS


/etc/network file:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens160

# DHCP not needed
# iface ens160 inet dhcp
iface ens160 inet static
address 192.168.10.17
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
gateway 192.168.10.15
dns-nameservers 192.168.10.1 192.168.10.6
pa4080
  • 30,621
NorbertFD
  • 3
  • 3

1 Answers1

1

everything looks fine on your server but when you try access to web server form another computer you need a dns server to try change website name to ip address. like your server that add two line in /etc/hosts add ip address and web site name in /etc/hosts in client side not only server .

Bahram
  • 83