Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Set up your own website

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Foreword:

When I was browsing other people's personal websites, I always envied how good they were. So when I learned about the Linux web server, I finally felt that what I had learned could come in handy. You can also maintain your own small website, so don't say much nonsense and start building services.

1. Preparatory work

Register a domain name of your own (about 40 to 50 a year)

Rent a VPS host (around 40 to 50 January)

(there is no advertising here. If friends don't know where to register domain names and VPS, I recommend going to Aliyun. If you don't plan to spend money, we can also build one on the intranet for learning purposes only. )

Deployment of 2.LAMP environment

2.1 install the package

[root@ch ~] # cat / etc/redhat-release & & uname-r # # below all use CentOS 6.7 installation instructions CentOS release 6.7 (Final) 2.6.32-573.el6.x86_64 [root@ch ~] # yum-y install httpd php mysqld php-mysql mysql-server # # install LAMP software package and relationship package

2.2 Program configuration

[root@ch ~] # cd / etc/httpd/conf/ [root@ch conf] # cp httpd.conf { .bak} # # backup httpd configuration file [root@ch conf] # service httpd start & & service mysqld start # # start the httpd and mysqld services [root@ch conf] # mysqladmin-u root password "123.com" # # create a password for the mysql database [root@ch conf] # mysql-u root-p # Log in to the mysql database Enter password: # # enter the database password mysql > CREATE DATABASE webDB that you just set # # create a database Query OK, 1 row affected (0.00 sec) mysql > GRANT ALL ON webDB.* TO "ch" @ "127.0.0.1" IDENTIFIED BY "ch.123"; # # authorize a user to log in from 127.0.0.1 and do all operations on the database Query OK, 0 rows affected (0.00 sec) mysql > quit # # exit database Bye

2.3 Service testing

[root@ch conf] # vim / var/www/html/index.php # # add the following content: [root@ch conf] # service httpd reload # # reload configuration file [root@ch conf] # curl http://172.18.20.12/index.php # # use other hosts better Succeed # # indicates that php connects to the database successfully

3. Build a site

3.1 download the package

Here are the official websites of three open source packages:

1. Https://cn.wordpress.org personal blog site

2. Http://www.discuz.net discussion group site

3. Http://www.phpwind.net community site

So let's take phpwind as an example:

[root@ch html] # unzip phpwind_UTF8_8.7.1.zip # # decompress the phpwind package [root@ch html] # chown-R root:apache upload/ # # modify the group to apache [root@ch html] # chmod-R Grouw upload/ # # add write permissions

3.2 install the package

Browser input: http://172.18.20.12/upload

After the environmental inspection, we will proceed directly to the next step.

When you are finished, you can manage our website in the background.

4. Actions after installation is completed

[root@ch html] # vim / etc/httpd/conf/httpd.conf # # modify the httpd configuration file # DocumentRoot "/ var/www/html" # # disable the central host # # enable the virtual host DocumentRoot / var/www/html/upload # # define the starting position of the URL path ServerName www.chen-hao.com.cn ErrorLog logs/phpwind/error_log # # define the storage path of the error log CustomLog logs/phpwind/access_log common # # define the storage path of the access log [root@ch html] # mkdir / var/log/httpd/phpwind # # create the storage path directory of the log [root@ch html] # service httpd reload # # overload configuration

After the configuration is completed, if you have your own domain name, you can go to the corresponding domain name management console. If the corresponding domain name is resolved to an IP address, it can be accessed through the domain name, and the website is basically built.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report