Table of Contents
php mysql apache ftp configuration under centOs, centosapache
Home Backend Development PHP Tutorial php mysql apache ftp configuration under centOs, centosapache_PHP tutorial

php mysql apache ftp configuration under centOs, centosapache_PHP tutorial

Jul 13, 2016 am 09:56 AM
centos

php mysql apache ftp configuration under centOs, centosapache

made corresponding notes when installing the server. This method is successful through personal experience. As the version is constantly updated, There may be some differences, but the basic principles are the same.

1. Install CentOS 6, you can choose minimal installation or desktop installation

2. Upgrade the system

yum update
3. Install mysql, set mysql to start automatically when booting, and start mysql at the same time

yum install mysql
yum install mysql-server
chkconfig --levels 35 mysqld on
service mysqld start

4. Configure the root password of mysql

mysql>; USE mysql;
mysql>; UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql> ;; FLUSH PRIVILEGES;

You can also use the mysql_secure_installation command to set the mysql password

mysql_secure_installation

Enter current password for root (enter for none): (Enter)
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorization.

Set root password? [Y/n] (Y)

New password: (123456)
Re-enter new password: (123456)
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]

(Whether to remove the default account of the database? If so, entering mysql directly in the terminal will prompt a connection error) Y

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]

(Whether root remote login is prohibited)Y
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

**Later set whether to allow remote login
mysql -u root -p
Enter Password:
mysql>GRANT ALL PRIVILEGES ON *.* TO 'username'@ '%' IDENTIFIED BY 'Password' WITH GRANT OPTION;
After completion, you can use mysql-front to remotely manage mysql.
Set to start at boot
chkconfig mysqld on

5. Install apache and set it to start at boot

yum install httpd
chkconfig --levels 35 httpd on
service httpd start
At this time you can test whether apache is working normally

It should be no problem to access localhost directly through the browser, but if other machines cannot access it, it is because of the firewall. Configure the firewall

(SSL will have this problem later)

6. Install php

If you install a version below php53, it may cause the project to be unable to run in this environment. When php5.2 is installed, the result will be
Now the project cannot run at all. After looking for the reason for a long time, I found out that the php version is too low (before this, I always thought it was because of json, because
php5.2 does not have json extension), so you must check the version before installation, otherwise it will be difficult to find out the cause of problems in the future project.

yum install php53

yum install php53-mysql php53-gd php53-imap php53-ldap php53-odbc php53-pear php53-xml php53-
xmlrpc
At this time, PHP is installed and pulled. Write a script to test it

vi /var/www/html/info.php
Enter

phpinfo();?>
Just visit localhost/info.php~

7. Install phpMyAdmin

First install the two large software warehouses epel and rpmfushion on the system

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
rpm -Uvh http://download1.rpmfusion.org /free/el/updates/testing/6/i386/rpmfusion-free-release-
6-0.1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/testing/6/i386/rpmfusion-
nonfree-release-6-0.1.noarch.rpm
If it is centos 5, execute the following

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh http://download1.rpmfusion .org/free/el/updates/testing/5/i386/rpmfusion-free-release-
5-0.1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-
nonfree-release-5-0.1.noarch.rpm
It is very convenient to install. You can get the latest version without downloading at all

yum install phpmyadmin
After the installation is completed, you need to configure the access permissions so that other machines besides this machine can also access phpMyAdmin

vi /etc/httpd/conf.d/phpMyAdmin.conf
Find the permission settings of the two directories, change Allow from to All


Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from All


Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from All

Restart the server

service httpd restart
Test localhost/phpMyAdmin

Username and password: root 123456

OK~ LAMP is set up,

8. Build SSL and let apache support https

yum install mod_ssl
In fact, after installing this module, you can use https://localhost to test after restarting apache, because it created a default certificate

Under /etc/pki/tls

Of course we can also use openssl to create our own certificate

yum install openssl
Generate certificate file
Create an rsa private key, the file name is server.key

openssl genrsa -out server.key 1024

Generating RSA private key, 1024 bit long modulus
............
............
e is 65537 (0x10001 )


Use server.key to generate a certificate signing request CSR

openssl req -new -key server.key -out server.csr
Country Name: two-letter country code
State or Province Name: province name
Locality Name: city name
Organization Name: Company name
Organizational Unit Name: Department name
Common Name: Your name
Email Address: Address
As for the 'extra' attributes, there is no need to enter them. Just press Enter

Generate certificate CRT file server.crt.

openssl x509 -days 365 -req -in server.csr -signkey server.key -out server.crt
Modify ssl.conf to specify our own generated certificate

vi /etc/httpd/conf.d/ssl.conf
Find the following location and modify the path

# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. A new
# certificate can be generated using the genkey(1) command.
SSLCertificateFile /etc/pki/tls/certs/localhost.crt

# Server Private Key:
# If the key is not combined with the certificate, use this
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

OK

service httpd restart

yum install vsftpd

2. Start/restart/shut down vsftpd server
/sbin/service vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
OK means the restart is successful .
Change restart to start/stop respectively for startup and shutdown.
If it is installed from source code, go to the installation folder to find the start.sh and shutdown.sh files and execute them.

Modify according to the following

vi /etc/vsftpd/vsftpd.conf

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO

# if your users expect that (022 is used by most other ftpd's)
local_umask=022
local_root=/

vi /etc/vsftpd/ftpusers

# Users that are not allowed to login via ftp
#root

vi /etc/vsftpd/user_list

# for users that are denied.
#root

Firewall configuration
a. Add. Allow access to port {80: http}.
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
b. Turn off the firewall {not recommended}.
service iptables stop
c. Reset the loading firewall
service iptables restart

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/987569.htmlTechArticlephp mysql apache ftp configuration under centOs, centosapache made corresponding notes when installing the server. This method is personally With successful experience, as the version is constantly updated, there may be...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to optimize CentOS HDFS configuration How to optimize CentOS HDFS configuration Apr 14, 2025 pm 07:15 PM

Improve HDFS performance on CentOS: A comprehensive optimization guide to optimize HDFS (Hadoop distributed file system) on CentOS requires comprehensive consideration of hardware, system configuration and network settings. This article provides a series of optimization strategies to help you improve HDFS performance. 1. Hardware upgrade and selection resource expansion: Increase the CPU, memory and storage capacity of the server as much as possible. High-performance hardware: adopts high-performance network cards and switches to improve network throughput. 2. System configuration fine-tuning kernel parameter adjustment: Modify /etc/sysctl.conf file to optimize kernel parameters such as TCP connection number, file handle number and memory management. For example, adjust TCP connection status and buffer size

Centos stops maintenance 2024 Centos stops maintenance 2024 Apr 14, 2025 pm 08:39 PM

CentOS will be shut down in 2024 because its upstream distribution, RHEL 8, has been shut down. This shutdown will affect the CentOS 8 system, preventing it from continuing to receive updates. Users should plan for migration, and recommended options include CentOS Stream, AlmaLinux, and Rocky Linux to keep the system safe and stable.

What are the backup methods for GitLab on CentOS What are the backup methods for GitLab on CentOS Apr 14, 2025 pm 05:33 PM

Backup and Recovery Policy of GitLab under CentOS System In order to ensure data security and recoverability, GitLab on CentOS provides a variety of backup methods. This article will introduce several common backup methods, configuration parameters and recovery processes in detail to help you establish a complete GitLab backup and recovery strategy. 1. Manual backup Use the gitlab-rakegitlab:backup:create command to execute manual backup. This command backs up key information such as GitLab repository, database, users, user groups, keys, and permissions. The default backup file is stored in the /var/opt/gitlab/backups directory. You can modify /etc/gitlab

How to check CentOS HDFS configuration How to check CentOS HDFS configuration Apr 14, 2025 pm 07:21 PM

Complete Guide to Checking HDFS Configuration in CentOS Systems This article will guide you how to effectively check the configuration and running status of HDFS on CentOS systems. The following steps will help you fully understand the setup and operation of HDFS. Verify Hadoop environment variable: First, make sure the Hadoop environment variable is set correctly. In the terminal, execute the following command to verify that Hadoop is installed and configured correctly: hadoopversion Check HDFS configuration file: The core configuration file of HDFS is located in the /etc/hadoop/conf/ directory, where core-site.xml and hdfs-site.xml are crucial. use

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

What is the CentOS MongoDB backup strategy? What is the CentOS MongoDB backup strategy? Apr 14, 2025 pm 04:51 PM

Detailed explanation of MongoDB efficient backup strategy under CentOS system This article will introduce in detail the various strategies for implementing MongoDB backup on CentOS system to ensure data security and business continuity. We will cover manual backups, timed backups, automated script backups, and backup methods in Docker container environments, and provide best practices for backup file management. Manual backup: Use the mongodump command to perform manual full backup, for example: mongodump-hlocalhost:27017-u username-p password-d database name-o/backup directory This command will export the data and metadata of the specified database to the specified backup directory.

Centos install mysql Centos install mysql Apr 14, 2025 pm 08:09 PM

Installing MySQL on CentOS involves the following steps: Adding the appropriate MySQL yum source. Execute the yum install mysql-server command to install the MySQL server. Use the mysql_secure_installation command to make security settings, such as setting the root user password. Customize the MySQL configuration file as needed. Tune MySQL parameters and optimize databases for performance.

Centos shutdown command line Centos shutdown command line Apr 14, 2025 pm 09:12 PM

The CentOS shutdown command is shutdown, and the syntax is shutdown [Options] Time [Information]. Options include: -h Stop the system immediately; -P Turn off the power after shutdown; -r restart; -t Waiting time. Times can be specified as immediate (now), minutes ( minutes), or a specific time (hh:mm). Added information can be displayed in system messages.

See all articles