ServerOk 4137a76d84 updated 3 years ago
..
1-apache-php-mysql.sh 5fc5ca0157 updated 5 years ago
basic.sh 4137a76d84 updated 3 years ago
environment.sh e973a2a830 renamed rhel to centos 6 years ago
nginx-php.sh 1a7ee2d615 updated 5 years ago
readme-apache.txt f008b2be84 updated 5 years ago
readme.txt bd0b841d9c updated 6 years ago
selinux-disable.sh e973a2a830 renamed rhel to centos 6 years ago

readme-apache.txt

DOMAIN_NAME
USERNAME
MYSQL_PASSWORD
admin@serverok.in

------------------

sed -i "s/PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config
service ssh restart

dd if=/dev/zero of=/swapfile bs=1M count=2048
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab

useradd -m --shell /bin/bash --home /home/DOMAIN_NAME USERNAME
passwd USERNAME

vi /etc/httpd/conf.d/DOMAIN_NAME.conf


ServerName DOMAIN_NAME
ServerAlias www.DOMAIN_NAME
ServerAdmin info@DOMAIN_NAME
DocumentRoot /home/DOMAIN_NAME/html

Options All -Indexes
AllowOverride All
Require all granted
Order allow,deny
allow from all



sed -i "s/User apache/User USERNAME/g" /etc/httpd/conf/httpd.conf
sed -i "s/Group apache/Group USERNAME/g" /etc/httpd/conf/httpd.conf

chown -R USERNAME:USERNAME /var/lib/php/

mkdir /home/DOMAIN_NAME/html/

echo " /home/DOMAIN_NAME/html/index.php
chown -R USERNAME:USERNAME /home/DOMAIN_NAME/
chmod -R 755 /home/DOMAIN_NAME/html/

mysql
create database USERNAME;
grant all on *.* to 'USERNAME'@'localhost' identified by 'MYSQL_PASSWORD';

systemctl restart httpd

curl http://DOMAIN_NAME

certbot --authenticator webroot --webroot-path /home/DOMAIN_NAME/html/ --installer apache --agree-tos --email admin@serverok.in -d DOMAIN_NAME -d www.DOMAIN_NAME