0

I set up a server for hosting sites eventually on linode. Using linux mint. Created a super user and added my other user not_root. Set up chrisbodnarchuk.com.conf. Had to restart apache and got below error. Apache2 is not running at all. This is apache on my ssh not my main machine.

not_root@grendeldServer:/etc/apache2/sites-available$ ls
000-default.conf  chrisbodnarchuk.com.conf  default-ssl.conf

not_root@grendeldServer:/etc/apache2/sites-available$ service apache2 reload
Failed to reload apache2.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status apache2.service' for details.

not_root@grendeldServer:/etc/apache2/sites-available$ 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: failed (Result: exit-code) since Fri 2017-09-01 12:01:01 CDT; 6min ag
Docs: man:systemd-sysv-generator(8)
Process: 4048 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILU
lines 1-7/7 (END)...skipping...
● 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: failed (Result: exit-code) since Fri 2017-09-01 12:01:01 CDT; 6min ago
 Docs: man:systemd-sysv-generator(8)
Process: 4048 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE

When i run sudo service apache2 reload i get

apache2.service is not active, cannot reload.

Also this

[Fri Sep 01 11:55:11.093487 2017] [core:warn] [pid 3790] AH00111: Config  variable ${APACHE_LOCK_DIR} is not defined
[Fri Sep 01 11:55:11.093766 2017] [core:warn] [pid 3790] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Fri Sep 01 11:55:11.093846 2017] [core:warn] [pid 3790] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Fri Sep 01 11:55:11.093913 2017] [core:warn] [pid 3790] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Fri Sep 01 11:55:11.094177 2017] [core:warn] [pid 3790] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
 [Fri Sep 01 11:55:11.097786 2017] [core:warn] [pid 3790:tid 139892600903552] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:

Not sure exactly where to begin to fix or if I should just reinstall Apache2 on the ssh else make a new user?

  • 1
    start here Syntax error on line 74 of /etc/apache2/apache2.conf please run cat /etc/apache2/apache2.conf and post it into your question. – George Udosen Sep 3 '17 at 20:52
  • 1
    Also a lot of config variables are not defined, maybe /etc/apache2/envvars is missing. – pa4080 Sep 3 '17 at 21:52
  • 1
    post output of apachectl -t that should let you know what the problem was. – Prince Adeyemi Sep 4 '17 at 8:51
  • thanks for the help everyone. I've yet to try it but I'll follow up once I'm back on that project. – grendeld Sep 5 '17 at 16:18
  • after apachectl -t AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 45.79.149.90. Set the 'ServerName' directive globally to suppress this message (2)No such file or directory: AH02291: Cannot access directory '/var/www/html/chrisbodnarchuk.com/log/' for error log of vhost defined at /etc/apache2/sites-enabled/chrisbodnarchuk.com.conf:4 AH00014: Configuration check failed Action '-t' failed. The Apache error log may have more information. @LasVegasCoder – grendeld Sep 19 '17 at 7:04
0

Fixing apache error AH02291

Apachectl -t error.

No such file or directory: AH02291: Cannot access directory '/var/www/html/chrisbodnarchuk.com/log/' for error log of vhost defined at /etc/apache2/sites-enabled/chrisbodnarchuk.com.conf:4 AH00014: Configuration check failed Action '-t' failed. The Apache error log may have more information.

Two errors to fix:

  1. Cannot access directory /var/www/html/chrisbodnarchuk.com/log/

    mkdir -p /var/www/html/chrisbodnarchuk.com/log The above will create log directory.

NOTE: if you defined a log file e.g /var/www/html/chrisbodnarchuk.com/log in your virtualHost config, you must touch /var/www/html/chrisbodnarchuk.com/log/error.log to avoid error, same for access.log (if any).

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using

To get rid of this error add the following to the top of your configuration:

NameVirtualHost localhost

You may add the above to your apache.conf

Hope this helps.

  • I'm wondering if I even needed to install apache2 on my ssh anyhow since apache was already downloaded by root on the linux system. Like it doesnt run because there are two instances of apache or something???? – grendeld Sep 20 '17 at 15:31
  • what is the output of netstat -plunt |grep -i ":80" – Prince Adeyemi Sep 21 '17 at 23:52
  • when i run this from my not_root ssh i get (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) When I run from same ssh with root i get Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg eth0 1500 0 443 0 0 0 245 0 0 0 BMRU lo 65536 0 0 0 0 0 0 0 0 0 LRU – grendeld Sep 22 '17 at 1:12
  • It looks like web server is not running . So you will install it with apt-get install build-essential apache2 apache2-utils -y Then restart web server with : service apache2 restart – Prince Adeyemi Sep 22 '17 at 1:23
  • i should be doing that from the root user in the ssh? Am I understanding correctly by the way that the sshs' apache2 has nothing to do with apache2 on my general linux machine? – grendeld Sep 22 '17 at 1:39

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.