sudo yum install httpd
sudo systemctl enable httpd
sudo systemctl start httpd
sudo httpd -v
sudo yum install epel-release yum-utils
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum-config-manager --enable remi-php73
sudo yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd
php -v
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
sudo systemctl status httpd
sudo firewall-cmd --zone=public --list-all
http://2.59.42.158 (проверить доступность хоста)
sudo mkdir -p /var/www/domain.name/public_html
sudo vim /var/www/
domain.name/public_html/index.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Welcome to example.com</title>
</head>
<body>
<h1>Success! example.com home page!</h1>
</body>
</html>
sudo vim /etc/httpd/conf.d/
domain.name.conf
<VirtualHost *:80>
ServerName domain.name
ServerAlias www.domain.name
ServerAdmin webmaster@localhost
DocumentRoot /var/www/domain.name/public_html
<Directory /var/www/domain.name/public_html>
Options -Indexes +FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/domain.name-error.log
CustomLog /var/log/httpd/domain.name-access.log combined
</VirtualHost>
sudo chown -R apache: /var/www/domain.name
Исправление ошибки с именем сервера при запуске apachectl configtest
sudo bash -c 'echo "ServerName \"2.59.42.158\"" >> /etc/httpd/conf/httpd.conf'
sudo systemctl restart httpd
sudo apachectl configtest
Проверить доступность к серверу по имени домена