Monday, September 14, 2020

Restarting apache2 (via systemctl): apache2.serviceJob for apache2.service failed because the control process exited with error code.

 



sudo /etc/init.d/apache2 restart    not starting



There is some syntax error in the file apache2.conf.

In a terminal, type:

cd /etc/apache2

Then:

apache2ctl configtest

Cannot load modules/mod_rewrite.so into server: /etc/apache2/modules/mod_rewrite.so: cannot open shared object file: No such file or directory


Enabling mod_rewrite

Now, we need to activate mod_rewrite.

  • sudo a2enmod rewrite

This will activate the module or alert you that the module is already in effect. To put these changes into effect, restart Apache.

  • sudo service apache2 restart


for 

LoadModule vhost_alias_module /usr/lib/apache2/modules/mod_vhost_alias.so
sudo a2enmod vhost_alias

Where is httpd.conf?

 

Ubuntu and debian   

/etc/apache2/apache2.conf

Centos and redhat

/etc/httpd/conf/httpd.conf

Monday, September 7, 2020

 

Creating a new user on ubuntu


sudo adduser <username>



to add this user to group


sudo addsuer <username> sudo