This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1: create a file named "myservice.service" in /etc/systemd/system | |
Step 2: Copy the below code to the file. Replace the path/to/my/script with yours. | |
[Unit] | |
Description=My Service | |
After=network.target | |
# Mention the required service after which our myservice needs to start | |
After=mysql.service | |
Requires=mysql.service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dpkg-reconfigure tzdata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------PHP versions---------------- | |
sudo apt show php | |
OR | |
sudo apt show php -a | |
//install default PHP version | |
sudo apt install php | |
First start by adding Ondřej Surý PPA to install different versions of PHP – PHP 5.6, PHP 7.0 and PHP 7.1 on Ubuntu system. | |
sudo apt install python-software-properties | |
sudo add-apt-repository ppa:ondrej/php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This file covers the steps for installing the SSL certificate in the Ubuntu 16.04 server. | |
1.Generate CSR | |
openssl req -new -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr | |
This will prompt for the following options | |
Common Name: The fully-qualified domain name, or URL, you're securing. | |
If you are requesting a Wildcard certificate, add an asterisk (*) to the left of the common name where you want the wildcard, for example *.coolexample.com. | |
Organization: The legally-registered name for your business. If you are enrolling as an individual, enter the certificate requestor's name. | |
Organization Unit: If applicable, enter the DBA (doing business as) name. | |
City or Locality: Name of the city where your organization is registered/located. Do not abbreviate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; | |
GRANT select ON dbname.* TO 'newuser'@'%'; //read only access | |
FLUSH PRIVILEGES; | |
apt-get install phpmyadmin php-mbstring php-gettext |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Allow Apache access to the folders and the files. | |
sudo chgrp -R www-data /var/www/html | |
sudo find /var/www/html -type d -exec chmod g+rx {} + | |
sudo find /var/www/html -type f -exec chmod g+r {} + | |
Give your owner read/write privileges to the folders and the files, and permit folder access to traverse the directory structure. | |
sudo chown -R USER /var/www/html/ | |
sudo find /var/www/html -type d -exec chmod u+rwx {} + | |
sudo find /var/www/html -type f -exec chmod u+rw {} + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat "public key" >> ~/.ssh/authorized_keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir topdir | |
$ chgrp http topdir | |
$ chmod g+s topdir | |
$ cd topdir | |
$ git clone .... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find files in between dates | |
find /path/to/folder -type f -name "file_name_starts_with*" -newermt 2020-01-07 ! -newermt 2020-01-08 -ls | |
Find and delete | |
find /path/to/folder -type f -name "file_name_starts_with*" -newermt 2020-01-07 ! -newermt 2020-01-08 -delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
While starting apache the below error pop up | |
No space left on device: AH00023: Couldn't create the ssl-cache mutex | |
Solution: | |
ipcs -s | awk -v user=apache '$3==user {system("ipcrm -s "$2)}' | |
Found solution from https://portal.cloudunboxed.net/knowledgebase/37/No-space-left-on-device-AH00023-Couldnt-create-the-rewrite-map-mutex.html |
OlderNewer