apache shutdown error , couldn’t release the accept mutex

to fix apache error

couldn’t release the accept mutex

in debian & ubuntu

do that

  1. Create the following file: /etc/apache2/conf-available/mutex.conf
  2. Add Mutex file:${APACHE_LOCK_DIR} default inside the newly created file
  3. Enable new configuration file with a2enconf mutex
  4. Restart Apache with systemctl restart apache2

ENABLE ROOT LOGIN OVER SSH

  1. As root, edit the sshd_config file in /etc/ssh/sshd_config:

    nano /etc/ssh/sshd_config
  2. Add a line in the Authentication section of the file that says PermitRootLogin yes. This line may already exist and be commented out with a “#”. In this case, remove the “#”.

    # Authentication:
    #LoginGraceTime 2m
    PermitRootLogin yes
    #StrictModes yes
    #MaxAuthTries 6
    #MaxSessions 10
  3. Save the updated /etc/ssh/sshd_config file.
  4. Restart the SSH server:

    service sshd restart

Deploying HTML, CSS webpage to Tomcat8

  1. Copy fonder /var/lib/tomcat8/webapps/ROOT to your folder.

    cp -r /var/lib/tomcat8/webapps/ROOT /var/lib/tomcat8/webapps/{yourfolder}

  2. add your htmls, css, js, in your folder.
  3. browser “http://localhost:8080/{yourfolder}”

Notes:

  1. if you using chrome web browser and did wrong folder before, then clean web browser’s cache(or change another name) otherwise (sometimes) it always 404.
  2. The folder META-INF with context.xml is needed.

Setup Tomcat 8 on Debian 8 on port 80

  1. Edit /etc/default/tomcat8.  At the very end, there should be a line that says AUTHBIND=no.  Change this to say AUTHBIND=yes
  2. Edit /etc/tomcat8/server.xml.  In this file, there is an XML tag that starts out with <Connector port=”8080″ ….  Change this to be 80.  There are two sections that you want to change this.
  3. Go to /etc/authbind/byport.  Do the following(note: this assumes that tomcat is running as the tomcat8 user, which it will do if you installed it through apt)
    $ cd /etc/authbind/byport
    $ touch 80
    $ chown tomcat8 80
    $ chmod 744 80
  4. Restart Tomcat   —  $ systemctl restart tomcat8
    You should now be able to access Tomcat on port 80.

Create Swap file on Linux

Create swap file

You will need to choose a location for your file. In this tutorial, it will be stored at the root of the server. We will create a 2GB swap file by running the following command:

dd if=/dev/zero of=/swapfile count=2048 bs=1M

The dd command will produce output in a similar format to:

2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 10.5356 s, 204 MB/s

Next, verify that the file is located at the root of your Vultr VPS by running:

ls / | grep swapfile

Proceed if you see the swapfile file.

 

Activate the swap file

Swap files are not recognized automatically. We will need to tell the server how to format the file and enable it so it can be used as a valid swap file. As a security measure, update the swapfile permissions to only allow R/W for root and no other users. Run:

chmod 600 /swapfile

The permission change can be verified by running the following command:

ls -lh /swapfile

You will see a file display:

-rw------- 1 root root 2.0G Oct  2 18:47 /swapfile

Next, tell the server to setup the swap file by running:

mkswap /swapfile

After running it, you will see the following output:

Setting up swapspace version 1, size = 2097148 KiB
no label, UUID=ff3fc469-9c4b-4913-b653-ec53d6460d0e

If everything is shown as above, you are now ready to move on to the next step.

Turn swap on

Once your file is ready to be used as swap, you need to enable it by running:

swapon /swapfile

You can verify that the swap file is active by running the free command again.

free -m

total       used       free     shared    buffers     cached
Mem:          1840       1754         86         16         23       1519
-/+ buffers/cache:        210       1630
Swap:         2047          0       2047

If Swap shows something other than 0, then you have successfully setup swap.

Enable swap on reboot

By default, your server will not automatically enable this new swap file. To enable it on boot, you can update the /etc/fstab file. Any text editor will suffice. In this example, I will be using nano.

nano /etc/fstab

Add the following line at the end of the file:

/swapfile   none    swap    sw    0   0

Save and close when you are finished editing the file. We are all done!