vwwwv
Anonymous
250 x views • 5 years ago
#! /bin/bash
echo "--> CentOS System, Pasang Apache, PHP, MariaDB <--"
echo "Nama Pelanggan : ";
read a;
echo "Selamat Datang Mr./Mrs. $a, Lanjut?";
read b;
#IP address are server.unixmen.local and 192.168.1.101/24
#__rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
sudo yum clean all
yum -y install epel-release
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum yum-utils
sudo yum update
sudo yum install httpd -y
yum install httpd -y
#yum -y install httpd
#service httpd status|start|stop|restart|reload
#systemctl status|start|stop|restart|reload httpd
#apachectl configtest| graceful
#systemctl start httpd.service
#systemctl enable httpd.service
sudo systemctl start httpd.service
systemctl enable httpd
#NOTE: Make notice that using this rule will lose its effect after a system reboot or firewalld service restart,
#because it opens on-fly rules, which are not applied permanently. To apply consistency
#iptables rules on firewall use –permanent option and restart firewalld service to take effect.
#_firewall-cmd --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd ––permanent ––add-port=80/tcp
sudo firewall-cmd ––permanent ––add-port=443/tcp
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
# firewall-cmd --state
# firewall-cmd --list-all
# firewall-cmd --list-interfaces
# firewall-cmd --get-service
# firewall-cmd --query-service service_name
# firewall-cmd --add-port=8080/tcp
#vi /etc/sysconfig/iptables
#-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEP
service iptables restart
systemctl restart firewalld
#ps aux | grep httpd
#dig +short myip.opendns.com @resolver1.opendns.com
#For now, Apache DocumentRoot path it’s set to /var/www/html system path, which by default doesnt provide any
#index file. If you want to see a directory list of your DocumentRoot path open Apache welcome configuration file
#and set Indexes statement from – to + on <LocationMach> directive, using the below screenshot as an example.
#_nano /etc/httpd/conf.d/welcome.conf
#find Options <LocationMach> change to Options +Indexes
#sudo yum install mariadb-server mariadb yum install mariadb-server mariadb -y
sudo yum install mariadb-server mariadb -y
#mysql_secure_installation
sudo mysql_secure_installation
sudo systemctl start mariadb
systemctl start mariadb
systemctl enable mariadb
#systemctl enable mariadb.service
sudo mariadb
#Sekarang, Anda dapat membuat pengguna baru dengan hak akses root dan akses berbasis kata sandi.
#Ubah nama pengguna dan kata sandi agar sesuai dengan yang Anda suka. Masukkan perintah ini.
#__mysql -u root -p
#__SHOW VARIABLES;
#__GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
#__FLUSH PRIVILEGES;
#__exit;
#__mariadb -u admin -p
#MYSQL
#__yum install mysql mysql-server -y
#__service mysqld start
#__chkconfig mysqld on
#__mysql_secure_installation
#_Set root password? [y/n] Y
#_New password: Type in a password you would like to use
#_Re-enter new password: Retype the password from the previous field
#_Remove anonymous users? [y/n] Y
#_Disallow root login remotely? [y/n] Y
#_Remove test database and access to it? [y/n] Y
#_Reload privilege tables now? [y/n] Y
#Enter current password for root (enter for none): ## Press Enter ##
#OK, successfully used password, moving on...
#Setting the root password ensures that nobody can log into the MySQL
#root user without the proper authorisation.
#Set root password? [Y/n] ## Press Enter ##
#New password: ## Enter new password ##
#Re-enter new password: ## Re-enter new password ##
#Password updated successfully!
#Remove anonymous users? [Y/n] ## Press Enter ##
#Disallow root login remotely? [Y/n] ## Press Enter ##
#Remove test database and access to it? [Y/n] ## Press Enter ##
#Reload privilege tables now? [Y/n] ## Press Enter ##
#We can install PHP 7.0 and the Apache PHP 7.0 module as follows:
#yum -y install php : DefaultPHP5
sudo yum-config-manager --enable remi-php73
yum-config-manager --enable remi-php72
yum-config-manager --enable remi-php73
service httpd restart
#yum install php php-mysql -y
sudo yum install php
systemctl restart httpd.service
service httpd start
chkconfig httpd on
yum search php
yum search php-
#yum install php -y step install some common PHP modules that are required by CMS Systems like Wordpress, Joomla, Drupal
yum -y install php php-mysql php-pdo php-gd php-mbstring php-pear php-opcache php-ldap php-odbc php-xml php-xmlrpc php-soap php-common php-mcrypt php-cli php-curl php-snmp php-imap php-devel php-mysqlnd curl curl-devel httpd-devel
sudo yum install nano
sudo yum install git
#If you get an error on PHP Date and Timezone, open php.ini configuration file, search and uncomment date.
#timezone statement, append your physical location and restart Apache daemon. https://php.net/manual/en/timezones.php
#__nano /etc/php.ini
#__date.timezone = Continent/City
#touch info.php or vi /var/www/html/info.php
#nano /var/www/html/info.php
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
sudo systemctl restart httpd.service
#systemctl restart httpd.service
#systemctl restart httpd
#sudo systemctl restart apache2
#service httpd restart
yum list updates
yum check-update
yum update
sudo yum update --security
#__setsebool httpd_disable_trans 1
#If you wanna to get MySQL support in your PHP, you should install "php-mysql"package.
#If you want to install all php modules just you use the command "yum install php*
#yum -y install phpMyAdmin
yum install phpmyadmin -y
#_nano /etc/httpd/conf.d/phpmyadmin.conf
#_vi /etc/httpd/conf.d/phpMyAdmin.conf
#Find and comment the whole /<Directory> section as shown below:
#Use a # and comment this lines.
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#_[...]
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
#<Directory /usr/share/phpMyAdmin/>
#___AddDefaultCharset UTF-8
# <IfModule mod_authz_core.c>
# # Apache 2.4
# <RequireAny>
# #_Require local
# Require ip 127.0.0.1
# Require ip ::1
# </RequireAny>
#_____Require all granted
# </IfModule>
# <IfModule !mod_authz_core.c>
# # Apache 2.2
# Order Deny,Allow
# Deny from All
# Allow from 127.0.0.1
# Allow from ::1
# </IfModule>
#</Directory>
#<strong>## Add the following lines:</strong>
#<Directory /usr/share/phpMyAdmin/>
# Options none
# AllowOverride Limit
# Require all granted
#</Directory>
<Directory /usr/share/phpMyAdmin/>
Options none
AllowOverride Limit
Require all granted
</Directory>
#_[...]
systemctl restart httpd.service
#Open "config.inc.php" file and change from "cookie" to "http" to change the authentication
#__cp /usr/share/phpMyAdmin/config.sample.inc.php /usr/share/phpMyAdmin/config.inc.php
#__vi /usr/share/phpMyAdmin/config.inc.php
#__vi /usr/share/phpmyadmin/config.inc.php
$cfg['blowfish_secret'] = 'ftwetwe94892fwbc'; //must fill this for cookie auth
#$cfg['blowfish_secret'] = '{^QP+-(3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V'; /*MUST FILL IN THIS FOR COOKIE AUTH! */
#__vi /etc/phpMyAdmin/config.inc.php
#_[...]
#_/* Authentication type */
#_$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
#_[...]
systemctl restart httpd.service
/etc/httpd/conf.d/MyWebsite.com.conf
/etc/httpd/conf.d/TestWebsite.com.conf
sudo vi /etc/httpd/conf.d/vhost.conf
#this will launch the Vi text editor,& create a new vhost.conf file in the /etc/httpd/conf.d find > NameVirtualHost *:80
#__<VirtualHost *:80>
#__ServerAdmin [email protected]
#__ServerName MyWebsite.com
#__ServerAlias www.MyWebsite.com
#__DocumentRoot /var/www/html/MyWebsite.com/public_html/
#__ErrorLog /var/www/html/MyWebsite.com/logs/error.log
#__CustomLog /var/www/html/MyWebsite.com/logs/access.log combined
#__</VirtualHost>
#__sudo mkdir /var/www/MyWebsite/{public_html, logs}
#__sudo systemctl restart httpd
#Apache Directories & Files main ways Apache functions is through configuration files. They are located at /etc/httpd.
#Apache has a main configuration file: /etc/httpd/conf/httpd.conf
#You can enhance Apache’s functionality by loading additional modules.
#The configuration files for these modules should be stored in: /etc/httpd/conf.modules.d/ directory.
#__sudo systemctl stop httpd
#Prevent or disable Apache from starting when the system boots:
#sudo systemctl disable httpd
#__su - root
#add
#__vi /etc/httpd/conf.d/userdir.conf
#__<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#__UserDir enabled unixmenuser
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disabled" line above, and uncomment
# the following line instead:
#
#__UserDir public_html
#__</IfModule>
#__<Directory /home/*/public_html>
#__Options Indexes Includes FollowSymLinks
##For apache 2.2,Please use:
#__AllowOverride All
#__Allow from all
#__Order deny,allow
#For apache >= 2.4,Please use :
#__Require all granted
#__</Directory>
#__systemctl restart httpd.service
#__mkdir /home/unixmenuser/public_html
#__chmod 711 /home/unixmenuser
#__chown unixmenuser:unixmenuser /home/unixmenuser/public_html
#__chmod 755 /home/unixmenuser/public_html
#__setsebool -P httpd_enable_homedirs true
#__chcon -R -t httpd_sys_content_t /home/unixmenuser/public_html
#__vi /home/unixmenuser/public_html/index.html
#__<html>
#__<body><div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">User unixmenuser Test</div></body>
#__</html>
#__chmod 644 /home/unixmenuser/public_html/index.html
#__http://ip/~username
#The default DocumentRoot for Apache is:
#__/var/www/html or /var/www/
#ubuntuDebian
#__/etc/apache2/sites-enabled/000-default
#__/etc/apache/apache2.conf
#centosRhelFedora
#__/etc/httpd/conf/httpd.conf
#To change the document root for your Apache web server simply open the corresponding file
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
#__DocumentRoot "/var/www/html"
# systemctl restart apache [For SystemD]
# service httpd restart [For SysVinit]
#__sudo ss -tulpn | egrep ':(80|443)'
#_vhost
vi httpd.conf
#find <VirtualHost *>
# My Virtual Hosts Config File for two Domains
NameVirtualHost *:80
#--<VirtualHost *:80>
#-- ServerAdmin [email protected]
#-- DocumentRoot "/usr/local/docs/theos.in"
#-- ServerName www.theos.in
#-- ServerAlias theos.in
#-- ErrorLog "/var/log/theos.in-error_log"
#-- CustomLog "/var/log/theos.in-access_log" common
#--</VirtualHost>
#--<VirtualHost *:80>
#-- ServerAdmin [email protected]
#-- DocumentRoot "/usr/local/docs/nixcraft.com"
#-- ServerName www.nixcraft.com
#-- ServerAlias nixcraft.com
#-- ErrorLog "/var/log/nixcraft.com-error_log"
#-- CustomLog "/var/log/nixcraft.com-access_log" common
#--</VirtualHost>
#https://www.cyberciti.biz/faq/ipv6-apache-configuration-tutorial/
#https://www.cyberciti.biz/faq/ipv6-apache-configuration-tutorial/
#https://www.cyberciti.biz/faq/apache-with-lets-encrypt-certificates-on-centos-8/
#https://www.cyberciti.biz/faq/apache-with-lets-encrypt-certificates-on-centos-8/
#https://www.cyberciti.biz/faq/star-stop-restart-apache2-webserver/
#https://www.cyberciti.biz/tips/rhel-centos-apache-chrootjail-virtual-hosting.html
#https://www.cyberciti.biz/faq/apache2-namevirtualhost-80-has-no-virtualhosts/
#https://www.cyberciti.biz/faq/howto-disable-httpd-selinux-security-protection/
#https://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/
#https://www.cyberciti.biz/tips/chroot-apache-under-rhel-fedora-centos-linux.html
#https://www.cyberciti.biz/faq/apache-name-based-virtualhost-example/
#https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-centos-7/
#https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-centos-7/
#Disable Apache SELinux Protection
#Open /etc/selinux/targeted/booleans file using a text editor:
# vi /etc/selinux/targeted/booleans
#Append or modify value for httpd_disable_trans as follows:
#httpd_disable_trans=1
# setsebool httpd_disable_trans 1
# /etc/init.d/httpd restart
#https://www.digitalocean.com/community/tutorials/how-to-move-an-apache-web-root-to-a-new-location-on-ubuntu-16-04
#https://www.linux.com/training-tutorials/apache-centos-linux-beginners/
#https://andykamt.com/mengaktifkan-apache-userdir-di-centos-7-rhel-7/
#https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-centos-8
#https://phoenixnap.com/kb/how-to-install-xampp-centos
#https://www.cyberciti.biz/tips/the-importance-of-linux-partitions.html
#https://www.cyberciti.biz/tips/rhel-centos-apache-chrootjail-virtual-hosting.html
#https://www.cyberciti.biz/faq/fedora-rhel-centos-configure-httpd-listen-multipleports/
#https://www.cyberciti.biz/faq/howto-lighttpd-virtualhost-configuration/
#https://www.cyberciti.biz/faq/how-to-secure-apache-with-mod_md-lets-encrypt-on-ubuntu-20-04-lts/
#https://www.cyberciti.biz/faq/apache-display-or-change-a-default-page-other-than-indexhtml/
#https://stackoverflow.com/questions/19322345/how-do-i-change-the-default-index-page-in-apache
#https://www.thegeekdiary.com/how-to-disable-the-default-apache-welcome-page-in-centos-rhel-7/
#https://www.tecmint.com/change-root-directory-of-apache-web-server/
#https://www.tecmint.com/goaccess-a-real-time-apache-and-nginx-web-server-log-analyzer/
#https://www.tecmint.com/forbidden-you-dont-have-permission-to-access-on-this-server-error/
#https://www.tecmint.com/install-varnish-cache-on-centos-7-for-apache/
#https://www.liquidweb.com/kb/apache-configuration-centos/
#https://www.unixmen.com/linux-basics-enable-apache-userdir-centos-7rhel-7/
#https://phoenixnap.com/kb/install-apache-on-centos-7
#https://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator
#https://www.tecmint.com/install-lamp-in-centos-7/
#https://www.unixmen.com/install-lamp-server-apache-mariadb-php-centosrhelscientific-linux-7/
#https://phoenixnap.com/kb/how-to-install-lamp-stack-on-centos
#https://www.niagahoster.co.id/blog/cara-install-lamp-di-centos-7/
#https://www.hostinger.com/tutorials/vps/how-to-install-lamp-stack-centos7
#http://192.168.0.100/phpmyadmin/
#https://www.hostinger.com/tutorials/vps/how-to-install-lamp-stack-centos7
#https://www.howtoforge.com/tutorial/centos-lamp-server-apache-mysql-php/
#https://www.howtoforge.com/apache_php_mysql_on_centos_7_lamp
#https://www.hostinger.co.id/tutorial/cara-install-apache-mysql-php-lamp-stack-di-centos-7
#https://www.unixmen.com/install-lamp-server-in-centos-6-4-rhel-6-4/
echo "--> CentOS System, Pasang Apache, PHP, MariaDB <--"
echo "Nama Pelanggan : ";
read a;
echo "Selamat Datang Mr./Mrs. $a, Lanjut?";
read b;
#IP address are server.unixmen.local and 192.168.1.101/24
#__rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
sudo yum clean all
yum -y install epel-release
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum yum-utils
sudo yum update
sudo yum install httpd -y
yum install httpd -y
#yum -y install httpd
#service httpd status|start|stop|restart|reload
#systemctl status|start|stop|restart|reload httpd
#apachectl configtest| graceful
#systemctl start httpd.service
#systemctl enable httpd.service
sudo systemctl start httpd.service
systemctl enable httpd
#NOTE: Make notice that using this rule will lose its effect after a system reboot or firewalld service restart,
#because it opens on-fly rules, which are not applied permanently. To apply consistency
#iptables rules on firewall use –permanent option and restart firewalld service to take effect.
#_firewall-cmd --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd ––permanent ––add-port=80/tcp
sudo firewall-cmd ––permanent ––add-port=443/tcp
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
# firewall-cmd --state
# firewall-cmd --list-all
# firewall-cmd --list-interfaces
# firewall-cmd --get-service
# firewall-cmd --query-service service_name
# firewall-cmd --add-port=8080/tcp
#vi /etc/sysconfig/iptables
#-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEP
service iptables restart
systemctl restart firewalld
#ps aux | grep httpd
#dig +short myip.opendns.com @resolver1.opendns.com
#For now, Apache DocumentRoot path it’s set to /var/www/html system path, which by default doesnt provide any
#index file. If you want to see a directory list of your DocumentRoot path open Apache welcome configuration file
#and set Indexes statement from – to + on <LocationMach> directive, using the below screenshot as an example.
#_nano /etc/httpd/conf.d/welcome.conf
#find Options <LocationMach> change to Options +Indexes
#sudo yum install mariadb-server mariadb yum install mariadb-server mariadb -y
sudo yum install mariadb-server mariadb -y
#mysql_secure_installation
sudo mysql_secure_installation
sudo systemctl start mariadb
systemctl start mariadb
systemctl enable mariadb
#systemctl enable mariadb.service
sudo mariadb
#Sekarang, Anda dapat membuat pengguna baru dengan hak akses root dan akses berbasis kata sandi.
#Ubah nama pengguna dan kata sandi agar sesuai dengan yang Anda suka. Masukkan perintah ini.
#__mysql -u root -p
#__SHOW VARIABLES;
#__GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
#__FLUSH PRIVILEGES;
#__exit;
#__mariadb -u admin -p
#MYSQL
#__yum install mysql mysql-server -y
#__service mysqld start
#__chkconfig mysqld on
#__mysql_secure_installation
#_Set root password? [y/n] Y
#_New password: Type in a password you would like to use
#_Re-enter new password: Retype the password from the previous field
#_Remove anonymous users? [y/n] Y
#_Disallow root login remotely? [y/n] Y
#_Remove test database and access to it? [y/n] Y
#_Reload privilege tables now? [y/n] Y
#Enter current password for root (enter for none): ## Press Enter ##
#OK, successfully used password, moving on...
#Setting the root password ensures that nobody can log into the MySQL
#root user without the proper authorisation.
#Set root password? [Y/n] ## Press Enter ##
#New password: ## Enter new password ##
#Re-enter new password: ## Re-enter new password ##
#Password updated successfully!
#Remove anonymous users? [Y/n] ## Press Enter ##
#Disallow root login remotely? [Y/n] ## Press Enter ##
#Remove test database and access to it? [Y/n] ## Press Enter ##
#Reload privilege tables now? [Y/n] ## Press Enter ##
#We can install PHP 7.0 and the Apache PHP 7.0 module as follows:
#yum -y install php : DefaultPHP5
sudo yum-config-manager --enable remi-php73
yum-config-manager --enable remi-php72
yum-config-manager --enable remi-php73
service httpd restart
#yum install php php-mysql -y
sudo yum install php
systemctl restart httpd.service
service httpd start
chkconfig httpd on
yum search php
yum search php-
#yum install php -y step install some common PHP modules that are required by CMS Systems like Wordpress, Joomla, Drupal
yum -y install php php-mysql php-pdo php-gd php-mbstring php-pear php-opcache php-ldap php-odbc php-xml php-xmlrpc php-soap php-common php-mcrypt php-cli php-curl php-snmp php-imap php-devel php-mysqlnd curl curl-devel httpd-devel
sudo yum install nano
sudo yum install git
#If you get an error on PHP Date and Timezone, open php.ini configuration file, search and uncomment date.
#timezone statement, append your physical location and restart Apache daemon. https://php.net/manual/en/timezones.php
#__nano /etc/php.ini
#__date.timezone = Continent/City
#touch info.php or vi /var/www/html/info.php
#nano /var/www/html/info.php
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
sudo systemctl restart httpd.service
#systemctl restart httpd.service
#systemctl restart httpd
#sudo systemctl restart apache2
#service httpd restart
yum list updates
yum check-update
yum update
sudo yum update --security
#__setsebool httpd_disable_trans 1
#If you wanna to get MySQL support in your PHP, you should install "php-mysql"package.
#If you want to install all php modules just you use the command "yum install php*
#yum -y install phpMyAdmin
yum install phpmyadmin -y
#_nano /etc/httpd/conf.d/phpmyadmin.conf
#_vi /etc/httpd/conf.d/phpMyAdmin.conf
#Find and comment the whole /<Directory> section as shown below:
#Use a # and comment this lines.
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#_[...]
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
#<Directory /usr/share/phpMyAdmin/>
#___AddDefaultCharset UTF-8
# <IfModule mod_authz_core.c>
# # Apache 2.4
# <RequireAny>
# #_Require local
# Require ip 127.0.0.1
# Require ip ::1
# </RequireAny>
#_____Require all granted
# </IfModule>
# <IfModule !mod_authz_core.c>
# # Apache 2.2
# Order Deny,Allow
# Deny from All
# Allow from 127.0.0.1
# Allow from ::1
# </IfModule>
#</Directory>
#<strong>## Add the following lines:</strong>
#<Directory /usr/share/phpMyAdmin/>
# Options none
# AllowOverride Limit
# Require all granted
#</Directory>
<Directory /usr/share/phpMyAdmin/>
Options none
AllowOverride Limit
Require all granted
</Directory>
#_[...]
systemctl restart httpd.service
#Open "config.inc.php" file and change from "cookie" to "http" to change the authentication
#__cp /usr/share/phpMyAdmin/config.sample.inc.php /usr/share/phpMyAdmin/config.inc.php
#__vi /usr/share/phpMyAdmin/config.inc.php
#__vi /usr/share/phpmyadmin/config.inc.php
$cfg['blowfish_secret'] = 'ftwetwe94892fwbc'; //must fill this for cookie auth
#$cfg['blowfish_secret'] = '{^QP+-(3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V'; /*MUST FILL IN THIS FOR COOKIE AUTH! */
#__vi /etc/phpMyAdmin/config.inc.php
#_[...]
#_/* Authentication type */
#_$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
#_[...]
systemctl restart httpd.service
/etc/httpd/conf.d/MyWebsite.com.conf
/etc/httpd/conf.d/TestWebsite.com.conf
sudo vi /etc/httpd/conf.d/vhost.conf
#this will launch the Vi text editor,& create a new vhost.conf file in the /etc/httpd/conf.d find > NameVirtualHost *:80
#__<VirtualHost *:80>
#__ServerAdmin [email protected]
#__ServerName MyWebsite.com
#__ServerAlias www.MyWebsite.com
#__DocumentRoot /var/www/html/MyWebsite.com/public_html/
#__ErrorLog /var/www/html/MyWebsite.com/logs/error.log
#__CustomLog /var/www/html/MyWebsite.com/logs/access.log combined
#__</VirtualHost>
#__sudo mkdir /var/www/MyWebsite/{public_html, logs}
#__sudo systemctl restart httpd
#Apache Directories & Files main ways Apache functions is through configuration files. They are located at /etc/httpd.
#Apache has a main configuration file: /etc/httpd/conf/httpd.conf
#You can enhance Apache’s functionality by loading additional modules.
#The configuration files for these modules should be stored in: /etc/httpd/conf.modules.d/ directory.
#__sudo systemctl stop httpd
#Prevent or disable Apache from starting when the system boots:
#sudo systemctl disable httpd
#__su - root
#add
#__vi /etc/httpd/conf.d/userdir.conf
#__<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#__UserDir enabled unixmenuser
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disabled" line above, and uncomment
# the following line instead:
#
#__UserDir public_html
#__</IfModule>
#__<Directory /home/*/public_html>
#__Options Indexes Includes FollowSymLinks
##For apache 2.2,Please use:
#__AllowOverride All
#__Allow from all
#__Order deny,allow
#For apache >= 2.4,Please use :
#__Require all granted
#__</Directory>
#__systemctl restart httpd.service
#__mkdir /home/unixmenuser/public_html
#__chmod 711 /home/unixmenuser
#__chown unixmenuser:unixmenuser /home/unixmenuser/public_html
#__chmod 755 /home/unixmenuser/public_html
#__setsebool -P httpd_enable_homedirs true
#__chcon -R -t httpd_sys_content_t /home/unixmenuser/public_html
#__vi /home/unixmenuser/public_html/index.html
#__<html>
#__<body><div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">User unixmenuser Test</div></body>
#__</html>
#__chmod 644 /home/unixmenuser/public_html/index.html
#__http://ip/~username
#The default DocumentRoot for Apache is:
#__/var/www/html or /var/www/
#ubuntuDebian
#__/etc/apache2/sites-enabled/000-default
#__/etc/apache/apache2.conf
#centosRhelFedora
#__/etc/httpd/conf/httpd.conf
#To change the document root for your Apache web server simply open the corresponding file
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
#__DocumentRoot "/var/www/html"
# systemctl restart apache [For SystemD]
# service httpd restart [For SysVinit]
#__sudo ss -tulpn | egrep ':(80|443)'
#_vhost
vi httpd.conf
#find <VirtualHost *>
# My Virtual Hosts Config File for two Domains
NameVirtualHost *:80
#--<VirtualHost *:80>
#-- ServerAdmin [email protected]
#-- DocumentRoot "/usr/local/docs/theos.in"
#-- ServerName www.theos.in
#-- ServerAlias theos.in
#-- ErrorLog "/var/log/theos.in-error_log"
#-- CustomLog "/var/log/theos.in-access_log" common
#--</VirtualHost>
#--<VirtualHost *:80>
#-- ServerAdmin [email protected]
#-- DocumentRoot "/usr/local/docs/nixcraft.com"
#-- ServerName www.nixcraft.com
#-- ServerAlias nixcraft.com
#-- ErrorLog "/var/log/nixcraft.com-error_log"
#-- CustomLog "/var/log/nixcraft.com-access_log" common
#--</VirtualHost>
#https://www.cyberciti.biz/faq/ipv6-apache-configuration-tutorial/
#https://www.cyberciti.biz/faq/ipv6-apache-configuration-tutorial/
#https://www.cyberciti.biz/faq/apache-with-lets-encrypt-certificates-on-centos-8/
#https://www.cyberciti.biz/faq/apache-with-lets-encrypt-certificates-on-centos-8/
#https://www.cyberciti.biz/faq/star-stop-restart-apache2-webserver/
#https://www.cyberciti.biz/tips/rhel-centos-apache-chrootjail-virtual-hosting.html
#https://www.cyberciti.biz/faq/apache2-namevirtualhost-80-has-no-virtualhosts/
#https://www.cyberciti.biz/faq/howto-disable-httpd-selinux-security-protection/
#https://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/
#https://www.cyberciti.biz/tips/chroot-apache-under-rhel-fedora-centos-linux.html
#https://www.cyberciti.biz/faq/apache-name-based-virtualhost-example/
#https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-centos-7/
#https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-centos-7/
#Disable Apache SELinux Protection
#Open /etc/selinux/targeted/booleans file using a text editor:
# vi /etc/selinux/targeted/booleans
#Append or modify value for httpd_disable_trans as follows:
#httpd_disable_trans=1
# setsebool httpd_disable_trans 1
# /etc/init.d/httpd restart
#https://www.digitalocean.com/community/tutorials/how-to-move-an-apache-web-root-to-a-new-location-on-ubuntu-16-04
#https://www.linux.com/training-tutorials/apache-centos-linux-beginners/
#https://andykamt.com/mengaktifkan-apache-userdir-di-centos-7-rhel-7/
#https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-centos-8
#https://phoenixnap.com/kb/how-to-install-xampp-centos
#https://www.cyberciti.biz/tips/the-importance-of-linux-partitions.html
#https://www.cyberciti.biz/tips/rhel-centos-apache-chrootjail-virtual-hosting.html
#https://www.cyberciti.biz/faq/fedora-rhel-centos-configure-httpd-listen-multipleports/
#https://www.cyberciti.biz/faq/howto-lighttpd-virtualhost-configuration/
#https://www.cyberciti.biz/faq/how-to-secure-apache-with-mod_md-lets-encrypt-on-ubuntu-20-04-lts/
#https://www.cyberciti.biz/faq/apache-display-or-change-a-default-page-other-than-indexhtml/
#https://stackoverflow.com/questions/19322345/how-do-i-change-the-default-index-page-in-apache
#https://www.thegeekdiary.com/how-to-disable-the-default-apache-welcome-page-in-centos-rhel-7/
#https://www.tecmint.com/change-root-directory-of-apache-web-server/
#https://www.tecmint.com/goaccess-a-real-time-apache-and-nginx-web-server-log-analyzer/
#https://www.tecmint.com/forbidden-you-dont-have-permission-to-access-on-this-server-error/
#https://www.tecmint.com/install-varnish-cache-on-centos-7-for-apache/
#https://www.liquidweb.com/kb/apache-configuration-centos/
#https://www.unixmen.com/linux-basics-enable-apache-userdir-centos-7rhel-7/
#https://phoenixnap.com/kb/install-apache-on-centos-7
#https://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator
#https://www.tecmint.com/install-lamp-in-centos-7/
#https://www.unixmen.com/install-lamp-server-apache-mariadb-php-centosrhelscientific-linux-7/
#https://phoenixnap.com/kb/how-to-install-lamp-stack-on-centos
#https://www.niagahoster.co.id/blog/cara-install-lamp-di-centos-7/
#https://www.hostinger.com/tutorials/vps/how-to-install-lamp-stack-centos7
#http://192.168.0.100/phpmyadmin/
#https://www.hostinger.com/tutorials/vps/how-to-install-lamp-stack-centos7
#https://www.howtoforge.com/tutorial/centos-lamp-server-apache-mysql-php/
#https://www.howtoforge.com/apache_php_mysql_on_centos_7_lamp
#https://www.hostinger.co.id/tutorial/cara-install-apache-mysql-php-lamp-stack-di-centos-7
#https://www.unixmen.com/install-lamp-server-in-centos-6-4-rhel-6-4/