Access virtual host from LAN

0

I am trying to access a virtual host that I have configured on a fedora server from another computer my lan with xip.io

My file /etc/httpd/conf.d/xxx.conf contains the following:

<VirtualHost *:80>
DocumentRoot /var/www/xxx
ServerName xxx
ServerAlias xxx.*.xip.io
</VirtualHost>

The file /etc/httpd/conf/httpd.conf is configured by default and in the file /etc/hosts I have added the following line

127.0.0.1   xxx

I do not know where I have the fault, but I can not make it work in any way for me to access the project website. In the beginning with http://xxx.ip-servidor.xip.io/ you should be able to access the web, but you can not connect to any site.

Edit. These are the errors shown by the apache log

[Fri Jan 12 16:28:55.440153 2018] [mpm_prefork:notice] [pid 6188] AH00170: caught SIGWINCH, shutting down gracefully
[Fri Jan 12 16:28:56.776160 2018] [suexec:notice] [pid 6241] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Jan 12 16:28:56.910534 2018] [lbmethod_heartbeat:notice] [pid 6241] AH02282: No slotmem from mod_heartmonitor
[Fri Jan 12 16:28:56.910654 2018] [http2:warn] [pid 6241] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Fri Jan 12 16:28:56.910672 2018] [http2:warn] [pid 6241] AH02951: mod_ssl does not seem to be enabled
[Fri Jan 12 16:28:56.961926 2018] [mpm_prefork:notice] [pid 6241] AH00163: Apache/2.4.27 (Fedora) SVN/1.9.7 configured -- resuming normal operations
[Fri Jan 12 16:28:56.962079 2018] [core:notice] [pid 6241] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
    
asked by yhazius 12.01.2018 в 16:00
source

2 answers

0

Please when you create virtualhost you should not do anything with httpd.conf , you must do the following

create a virtualhost in the folder /etc/apache/site-available/ the name should be something like tusitio.conf assuming that your site is xip the ideal is to create it so xip.conf

<VirtualHost *:80>
  ServerName xip.io
  ServerAlias www.xip.io
  DocumentRoot /var/www/xxx
  <Directory "/var/www/xxx">
  Options Indexes FollowSymLinks MultiViews
  AllowOverride all
  </Directory>
</VirtualHost>

run the command to add your virtualhost to apache2

sudo a2ensite xip.conf 

and then you must restart the site

sudo apache2 restart

If for some reason you want to download the default apache site, you must execute the following command:

sudo a2dissite default.conf
    
answered by 12.01.2018 в 18:26
0

1) Have a telnet IP-Server Port, for example:

$ telnet 192.168.100.4 80
Trying 192.168.100.4...
Connected to 192.168.100.4.
Escape character is '^]'.

And you should see a message like the one above if after a few minutes it does not connect then the firewall is blocking access to your site you can do the following:

2) Deactivate the firewall wall (Not recommended on production servers or facing the Internet)

$ sudo systemctl stop firewalld
$ sudo systemctl disable firewalld (Impide que se inicie el muro cortafuegos al iniciar el SO)

3) Add to the firewall wall the range of IPs that will have access to the web server (Recommended option)

$ sudo  firewall-cmd --permanent --zone=trusted --add-source=192.168.0.0/24 (Pon tu rango de IPs de tu LAN)

Refresh firewall rules

$ sudo firewall-cmd --reload

[1] link

    
answered by 12.01.2018 в 23:38