当前位置:网站首页>Configure lamp+supervisor
Configure lamp+supervisor
2022-07-02 17:22:00 【php_ kevlin】
( Inventory articles )
One . install apache
yum list installed | grep httpd // View local httpd Installation package
yum install httpd -y
systemctl start httpd.service
systemctl enable httpd.service // Boot up
Two . install Mysql
1. download mysql Source installation package
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
2. Use yum Install the downloaded source installation package locally
yum localinstall mysql57-community-release-el7-11.noarch.rpm -y
3. Check mysql Source installed successfully
yum repolist enabled | grep "mysql.*-community.*"
4. modify yum Source 【 Skippable 】
vim /etc/yum.repos.d/mysql-community.repo
Change the default installed mysql edition . For example, to install 5.6 edition , take 5.7 The source of enabled=1 Change to enabled=0. And then 5.6 The source of enabled=0 Change to enabled=1 that will do .
If you make a mistake :
Source “MySQL 5.7 Community Server” Of GPG Key installed , But not for this package . Please check the public key of the source URL Whether the configuration is correct . The failed package is :mysql-community-libs-compat-5.7.37-1.el7.x86_64
GPG The key is configured as :file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Execute this command :rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
5. install mysql
yum install mysql-community-server -y
- start-up mysql And check its status
Start command :systemctl start mysqld
View its status command :systemctl status mysqld
- Set up mysql Serving the system , Start as the system starts
command :systemctl enable mysqld
command :systemctl daemon-reload
- see mysql Next root The default password of the account
mysql5.7 After installation , stay /var/log/mysqld.log In the document root Generated a default password . Find... In the following way root Default password , Then login mysql.
command :grep ‘temporary password’ /var/log/mysqld.log
[[email protected] package]# grep 'temporary password' /var/log/mysqld.log
2022-01-30T01:39:40.234451Z 1 [Note] A temporary password is generated for [email protected]: >uDedmEH,2*2
among >uDedmEH,2*2 Part is the default password
9.2. modify my.cnf file (/etc/my.cnf)
9.2.1. Change password policy
stay mysql Configuration file for my.cnf Add the following settings to the file
Password selection policy : validate_password_policy = 0
If you don't need a password policy , Disable password policy :
validate_password = off
( There is a problem )
First look at the log , Positioning error . Use the following command to view the log :
cat /var/log/mysqld.log | grep 'ERROR'
9.2.2. Modify the character encoding to utf8
stay my.cnf Medium [mysqld] Add the following configuration
character_set_server = utf8init_connect = 'SET NAMES utf8'
restart mysql, Make configuration effective
command :systemctl restart mysqld
- Sign in mysql
command :mysql -uroot -p
Input password : The default is just found Jb2h<%lp9itY
- Change Password
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'
Or order :set password for 'root'@'localhost'=password('123456')
;
- Add remote account
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
Make settings effective
FLUSH PRIVILEGES;
3、 ... and . install PHP
1. install epel-release
yum install epel-release -y
2. Switch source
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Use yum list Command to view installable packages (Packege)
yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
3. install php56 And related expansion packages
yum install -y --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-fpm php-soap php-gd --skip-broken
Subsequent complement
yum install -y --enablerepo=remi --enablerepo=remi-php56 php-soapyum install -y --enablerepo=remi --enablerepo=remi-php56 php-gd
4. Configure boot service ( restart apache Extension takes effect )
systemctl restart php-fpmsystemctl enable php-fpm
5. Check whether the installation is successful
ps -ef | grep phpnetstat -anp | grep 9000
3. Modify the configuration file , Configure the corresponding virtual domain name , And then restart apache
#/etc/httpd/conf/httpd.conf The last line Include conf/extra/*.conf
#/etc/httpd/conf/extra/httpd-vhost.conf<VirtualHost *:80> DocumentRoot "/project/www.baidu.com/htdocs" ServerName www.dmd.test ErrorLog "/var/log/dmd_error.log" CustomLog "/var/log/dmd_access.log" common <Directory "/project/www.baidu.com"> Options FollowSymLinks ExecCGI AllowOverride All Require all granted DirectoryIndex index.php index.html error/index.html </Directory> Alias /admin /project/www.baidu.com/libs/dmdelivery/admin Alias /x /project/www.baidu.com/libs/dmdelivery/htdocs Alias /mailings /project/www.baidu.com/mailings SetEnv CONFIG_DIR /project/www.baidu.com/admin</VirtualHost>
4. stay php.ini Set in date.timezone The value of is PRC, Set the future as :date.timezone=PRC, At the same time, uncomment this line of code , That is, remove the semicolon in front
[[email protected] libs]# vi /etc/php.ini [[email protected] libs]# systemctl restart httpd
5. Preliminary completion
Four : install supervisor
1. Use yum install supervisor
yum install supervisor -y
Set power on self start
systemctl enable supervisord.service
2. By default /etc/supervisord.conf
file , Modify the last line
[include]files = /data/supervisord.d/*.ini
3. start-up
supervisord -c /etc/supervisord.conf # Start with the default configuration file , namely /etc/supervisord.conf
First of all to enter supervisor Console :
supervisorctl
Then read the configuration again :
reread
Update configuration :
update
Start all configurations :
start all
View all status :
status
边栏推荐
- executescalar mysql_ExecuteScalar()
- Qstype implementation of self drawing interface project practice (II)
- Introduce the scrollintoview() method attribute in detail
- SSB threshold_ SSB modulation "suggestions collection"
- IPtables中SNAT、DNAT和MASQUERADE的含义
- QWebEngineView崩溃及替代方案
- Exploration of mobile application performance tools
- 宝宝巴士创业板IPO被终止:曾拟募资18亿 唐光宇控制47%股权
- Ocio V2 reverse LUT
- [shutter] dart data type (dynamic data type)
猜你喜欢
Cell: Tsinghua Chenggong group revealed an odor of skin flora. Volatiles promote flavivirus to infect the host and attract mosquitoes
Sword finger offer 24 Reverse linked list
深度之眼(三)——矩阵的行列式
剑指 Offer 22. 链表中倒数第k个节点
Believe in yourself and finish the JVM interview this time
Timing / counter of 32 and 51 single chip microcomputer
Weili holdings listed on the Hong Kong Stock Exchange: with a market value of HK $500million, it contributed an IPO to Hubei
Soul, a social meta universe platform, rushed to Hong Kong stocks: Tencent is a shareholder with an annual revenue of 1.28 billion
剑指 Offer 26. 树的子结构
Configure ARP table entry restrictions and port security based on the interface (restrict users' private access to fool switches or illegal host access)
随机推荐
IDEA2021.1 安装教程
[leetcode] 14. Préfixe public le plus long
ROS知识点——消息过滤器 ( message_filters)
Changwan group rushed to Hong Kong stocks: the annual revenue was 289million, and Liu Hui had 53.46% voting rights
chmod命令原理及用法详解[通俗易懂]
Connect Porsche and 3PL EDI cases
几行代码搞定RPC服务注册和发现
Introduction to nexus and detailed tutorial of Xiaobai using idea to package and upload to nexus3 private server
What is agile development process
Linux Installation PostgreSQL + Patroni cluster problem
Timing / counter of 32 and 51 single chip microcomputer
ThreadLocal
什么是敏捷开发流程
默认浏览器设置不了怎么办?
Eye of depth (II) -- matrix and its basic operations
Explanation of traceroute command
畅玩集团冲刺港股:年营收2.89亿 刘辉有53.46%投票权
Visibilitychange – refresh the page data when the specified tab is visible
Nexus Introduction and Xiaobai use idea Packaging and Upload to Nexus 3 private service detailed tutoriel
executescalar mysql_ ExecuteScalar()