Home > Operation and Maintenance > CentOS > How to build a website on centos

How to build a website on centos

WJ
Release: 2020-06-06 16:30:27
Original
3715 people have browsed it

How to build a website on centos

How to build a website in centos?

1, check whether the database is installed

rpm -qa | grep mysqld
Copy after login

How to build a website on centos

2, start the database and set the account password for the database

service mysqld start //启动数据库
mysqladmin -u 账号 password 密码 //设置数据库账号密码
Copy after login

How to build a website on centos

How to build a website on centos

3, enter the database and create a database

mysql -u 账号 -p //进入数据库,输入这个后会让你输入密码,密码不会显示出来但确实输入
create database wordpress; //创建名字为wordpress的数据库
quit; 退出数据库
Copy after login

How to build a website on centos

How to build a website on centos

## 4. Create a website directory. And use the upload tool to upload the website to the created website directory (the host is the IP, the username is the centos username, and the password is the centos user password)

How to build a website on centos

How to build a website on centos

5, hang on the CD and install unzip to decompress the website compressed package

mount /dev/cdrom /mnt
rpm -ivh /mnt/Packages/unzip-6.0-1.el6.i686.rpm
Copy after login

How to build a website on centos

How to build a website on centos##6, Enter the website directory and decompress

cd /www/luntan
unzip wordpress-4.9.4-zh_CN.zip
ll /www/luntan //查看是否解压成功
Copy after login

How to build a website on centos

How to build a website on centos

7, modify the Apache configuration file, and add port 81, G Jump to the last line and find this to modify the port number and website path

vim /etc/httpd/conf/httpd.conf
shift+?//后面跟查找关键字符
shift+g //到最底部
gg+行数 //到指定行数
Copy after login

How to build a website on centos

How to build a website on centos8, restart the mysql and httpd services and close both Firewall

service mysqld restart    //mysqld服务
service httpd restart    //Apache服务
service iptables stop //iptables防火墙
setenforce 0 //selinux防火墙
Copy after login

9. Open the browser and enter IP:port number in the URL bar, and follow the steps in the picture to succeed (enter the IP to start the installation, the user name is the database user name, and the password is also the database password)

How to build a website on centosRelated references:

centOS Tutorial

The above is the detailed content of How to build a website on centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template