How To Setup Rhel Web Server And Install Litecart

عنوان

OldNew
11How To Setup Rhel Web Server And Install Litecart

الرابط الدائم

OldNew
11how_to_setup_rhel_web_server_and_install_litecart

المحتوى

OldNew
1# How to setup a RHEL web server and install LiteCart
12
3For this tutorial we are assuming you already made a clean minimum
4installation of a RHEL 9.x OS (i.e. Red Hat Enterprise, Fedora, CentOS
5Stream, Alma Linux, or Rocky Linux).
6
7# How to setup the server
8
9# Update all OS components
10
11dnf update
12
13# Install stuff we need
14
15dnf -y install nano unzip
16
17# Install locales (Example: glibc-langpack-{language_code})
18
19dnf -y install glibc-langpack-en
20
21# Install repository for extra packages like php-imagick
22
23dnf -y install epel-release
24
25# Install server daemons and extensions
26
27dnf -y install httpd mod_ssl mariadb-server php php-bcmath php-intl
28php-apcu php-gd php-json php-mysqlnd php-simplexml php-zip
29
30# Change PHP distribution to version 8.1
31
32dnf module switch-to php:8.1
33
34# Start our new services
35
36systemctl enable php-fpm systemctl start php-fpm
37
38systemctl enable httpd systemctl start httpd
39
40systemctl enable mariadb systemctl start mariadb
41
42# Run the guide for securing MariaDB/MySQL
43
44mysql_secure_installation
45
46# Alternatively run a handsfree command for securing MariaDB/MySQL
47 (edit it first)
48
49mysql -uroot -e "ALTER USER 'root'@'localhost' IDENTIFIED BY
50'{desired_root_password_here}'; \ GRANT ALL PRIVILEGES ON *.* TO
51'root'@'localhost' WITH GRANT OPTION; \ DROP USER IF EXISTS
52''@'localhost'; \ DROP DATABASE IF EXISTS test; \ FLUSH
53PRIVILEGES;"
54
55# Allow outgoing traffic for the web server (SELinux)
56
57setsebool -P httpd_can_network_connect 1 setsebool -P httpd_unified 1
58
59# Allow incoming connections to the webserver through the firewall
60
61firewall-cmd --permanent --add-service=http firewall-cmd --permanent
62--add-service=https firewall-cmd --permanent --list-all firewall-cmd
63--reload
64
65# Create a MySQL user, database, and grant privileges
66
67read -p "New database name: " newdb_name read -p "New database user:
68" newdb_user read -sp "Password for database user '$newdb_user': "
69newdb_password
70
71mysql -u root -p -e "CREATE DATABASE $newdb_name; \ CREATE USER
72'$newdb_user'@'localhost' IDENTIFIED BY '$newdb_password'; \
73GRANT ALL PRIVILEGES ON $newdb_name.* TO
74'$newdb_user'@'localhost' WITH GRANT OPTION; \ FLUSH PRIVILEGES;"
75
76## Install LiteCart
77
78Go to the document root for your site, remove default index page,
79download the LiteCart web installer and setting the correct permissions:
80
81# Go to the document root for your site
82
83cd /var/www/html
84
85# Download the LiteCart web installer
86
87curl --output index.php
88
89
90# Change owner of the files to apache
91
92chown -R apache:apache ./
93
941.
952. Open your browser and visit your website to begin installing
96 LiteCart. #
973. #
98 1.
99
100# When the LiteCart web installation is completed, do some cleanup:
101
102rm -Rf install/

تم التعديل بواسطة litecart في 29 ديسمبر 2023 at 04:28

عرض الكود على GitHub