0

I've been trying for 2 days to just run my vhost that worked perfectly until now. I searched without being able to find the solution.The site is already enabled. Here is the error i got: This site is inaccessible project.local does not allow the connection. Do a Google search on local project. ERR_CONNECTION_REFUSED

Here are my configuration files:

projet.conf 

ServerName projet.local
ServerAdmin webmaster@localhost
DocumentRoot "/home/malik/WCS"
<Directory "/home/malik/WCS" >
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
</Directory>    

in ect/hosts:

127.0.0.1   projet.local

/var/log/apache2/access.log.1:

127.0.0.1 - - [30/Oct/2018:15:16:16 +0100] "GET / HTTP/1.1" 200 771 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36"
127.0.0.1 - - [30/Oct/2018:17:28:13 +0100] "GET / HTTP/1.1" 200 771 

error.log.1 :

[Wed Dec 19 09:58:34.636654 2018] [mpm_prefork:notice] [pid 1436] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Dec 19 09:58:34.636691 2018] [core:notice] [pid 1436] AH00094: Command line: '/usr/sbin/apache2'
[Thu Dec 20 02:22:52.333222 2018] [core:warn] [pid 1436] AH00045: child process 4808 still did not exit, sending a SIGTERM
[Thu Dec 20 02:22:52.448879 2018] [core:warn] [pid 1436] AH00045: child process 4809 still did not exit, sending a SIGTERM
[Thu Dec 20 02:22:52.448895 2018] [core:warn] [pid 1436] AH00045: child process 4810 still did not exit, sending a SIGTERM
[Thu Dec 20 02:22:52.448900 2018] [core:warn] [pid 1436] AH00045: child process 4811 still did not exit, sending a SIGTERM
[Thu Dec 20 02:22:52.448904 2018] [core:warn] [pid 1436] AH00045: child process 4812 still did not exit, sending a SIGTERM
Cannot load Xdebug - it was already loaded
Cannot load Xdebug - it was already loaded
Cannot load Xdebug - it was already loaded
Cannot load Xdebug - it was already loaded
Cannot load Xdebug - it was already loaded
Cannot load Xdebug - it was already loaded
Cannot load Xdebug - it was already loaded
Cannot load Xdebug - it was already loaded
Cannot load Xdebug - it was already loaded
Cannot load Xdebug - it was already loaded
[Thu Dec 20 02:22:53.465018 2018] [mpm_prefork:notice] [pid 1436] AH00169: caught SIGTERM, shutting down
Cannot load Xdebug - it was already loaded
Cannot load Xdebug - it was already loaded

$ sudo netstat -plnt
Proto Recv-Q Send-Q Adresse locale          Adresse distante        Etat       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1169/mysqld     
tcp        0      0 127.0.0.1:63342         0.0.0.0:*               LISTEN      4608/java       
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      2182/dnsmasq    
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      4456/cupsd      
tcp        0      0 127.0.0.1:6942          0.0.0.0:*               LISTEN      4608/java       
tcp6       0      0 ::1:631                 :::*                    LISTEN      4456/cupsd   

$ apachectl -S
[Thu Jan 03 17:49:33.928029 2019] [so:warn] [pid 5785] AH01574: module php7_module is already loaded, skipping
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:

127.0.0.1:80           is a NameVirtualHost
         default server localhost (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost localhost (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost blog.local (/etc/apache2/sites-enabled/blog.conf:1)
         port 80 namevhost hph.local (/etc/apache2/sites-enabled/hph.conf:1)
         port 80 namevhost librairie.dev (/etc/apache2/sites-enabled/librairie.conf:1)
         port 80 namevhost projet.local (/etc/apache2/sites-enabled/projet.conf:1)
         port 80 namevhost symfony.local (/etc/apache2/sites-enabled/symfony.conf:1)
127.0.1.1:80           cornac.local (/etc/apache2/sites-enabled/cornac.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex rewrite-map: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used

sudo systemctl start apache2.service

systemctl status apache2.service

apache2.service - LSB: Apache2 web server Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled) Drop-In: /lib/systemd/system/apache2.service.d └─apache2-systemd.conf Active: inactive (dead) since jeu. 2019-01-03 21:30:34 CET; 2min 9s ago Docs: man:systemd-sysv-generator(8) Process: 13298 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS) Process: 13274 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

janv. 03 21:30:20 malik-X751LJ apache2[13274]: * Starting Apache httpd web server apache2 janv. 03 21:30:27 malik-X751LJ apache2[13274]: [Thu Jan 03 21:30:27.211423 2019] [so:warn] [pid 13291] AH01574: module php7_module is already loaded, skipping janv. 03 21:30:32 malik-X751LJ apache2[13274]: [Thu Jan 03 21:30:32.218467 2019] [core:error] [pid 13291] (EAI 2)Name or service not known: AH00547: Could not resolve ho janv. 03 21:30:32 malik-X751LJ apache2[13274]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerN janv. 03 21:30:34 malik-X751LJ apache2[13274]: Segmentation fault (core dumped) janv. 03 21:30:34 malik-X751LJ apache2[13274]: Action 'start' failed. janv. 03 21:30:34 malik-X751LJ apache2[13274]: The Apache error log may have more information. janv. 03 21:30:34 malik-X751LJ apache2[13298]: * Stopping Apache httpd web server apache2 janv. 03 21:30:34 malik-X751LJ apache2[13298]: * janv. 03 21:30:34 malik-X751LJ systemd[1]: Started LSB: Apache2 web server.

Any help would be appreciate, Thanks

  • 1
    Note that if you only have a single VHOST online you will still get a connection - CONNECTION REFUSED usually indicates Apache is not listening properly. – Thomas Ward Jan 2 at 17:16
  • thanks for your return. I have several vhosts that worked until now. I just put this one as an example. I really do not understand why nothing works now – Touco Jan 2 at 17:41
  • 2
    Connection Refused usually means you have Apache problems somewhere. Confirm that Apache is listening by checking sudo netstat -tulpn | grep :80 to see if Apache is even listening on port 80. – Thomas Ward Jan 2 at 17:50
  • what is the expected result of this order? because nothing is happening – Touco Jan 2 at 17:55
  • i got this when i run sudo service apache2 status – Touco Jan 2 at 18:00
0

Your ServerName parameter is set to projet.local when you really want it to be project.local.

Change that, save, reload apache2 (sudo systemctl reload apache2) and try again.

You will also need to update your /etc/hosts (note: etc and not ect also) file as it's spelt wrong in there too.

  • hank you jamie but project or project I do not think the problem is there. It used to work like any other vhost I created. I admit that I really do not see where this issue comes from – Touco Jan 2 at 17:43
  • 1
    @Touco Your error message says This site is inaccessible project.local but it is configured as projet.local (without the c. – PerlDuck Jan 2 at 17:46
  • @PerlDuck it's just because of the translation, i am french. The server name is projet.local without the c – Touco Jan 2 at 17:52
  • @Touco try to run echo Listen 80 >> /etc/apache2/ports.conf and stop, disable, enable, start your apache2!! – abu-ahmed al-khatiri Jan 3 at 10:36
  • @abu-ahmedal-khatiri may i add echo listen 80 in the ports.conf file? i m not sure to understand what to do – Touco Jan 3 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.