foreword
This notebook is implemented based on the command line. Readers who want to use the interface to quickly build can install Pagoda Build.
Keywords: domain name, SSL certificate, public network IP, intranet penetration, cloud server, nginx, mysql, php, typecho, filing.
Friends chain: Li Zhuming Blog
Personal blog system screening
WordPress, Typecho, Zblog and other PHP blog programs:
Intranet penetration
If it is a personal host or a host without a public IP, intranet penetration is required.
refer to:
If there is a fixed public IP, you can directly use the public IP. Such as cloud server.
install nginx
refer to:
Install PHP
Install php7.4
sudo apt-get install php7.4 php7.4-fpm php7.4-mysql php7.4-gd php7.4-mbstring
start up:
sudo service php7.4-fpm start
Configure php monitoring: file: /etc/php/7.4/fpm/pool.d/www.conf
Find the listen item and change /run/php/php7.4-fpm.sock to 127.0.0.1:6000. (Address and port are optional)
sudo vim /etc/php/7.4/fpm/pool.d/www.conf
Restart the server:
sudo service php7.4-fpm reload
install mysql
Install mysql:
sudo apt install mysql-server
Solve the problem that mysql cannot be started under ubuntu using service:
# download mysql service mysql start # update software apt-get upgrade # restart mysql service mysql start
Modify the mysql user name and password: and then log in by specifying the user and password after logging in: mysql -u root -p
mysql # After entering mysql, change the root password to mynewpassword ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword'; exit
The mysql command to create the database:
mysql -u root -p CREATE DATABASE typecho_blog; exit
Query the current database:
Typecho
- Typecho official website: typecho.org
- Typecho GitHub address: https://github.com/typecho/typecho
Components required by Typecho:
- PHP5.1 or above
- Support Mysql, PostgreSQL , any one of SQLite and related extensions installed in PHP
- CURL or Socket support
- mbstring or iconv extension support
typecho theme recommendation: https://www.zhihu.com/question/55808592
joe topic: https://github.com/HaoOuBa/Joe.git
Environment installation
Based on ubuntu:
refer to
ubuntu manually builds a typecho blog: https://blog.csdn.net/diqiudq/article/details/126425003
install typecho
# new directory mkdir -p /lzm/work/blog_server/typecho # enter directory cd /lzm/work/blog_server/typecho # Download the source code (can be found on typecho official website) wget https://github.com/typecho/typecho/releases/latest/download/typecho.zip # Unzip the source code unzip typecho.zip # Give sufficient permissions to the entire source code directory (grant permissions according to your actual situation) chmod -R 777 /lzm/work/blog_server/typecho
Nginx and PHP connect configuration & specify blog path
server { listen 80; # Fill in your listening address server_name xxx.com localhost; root /lzm/work/blog_server/typecho; index index.php; location ~ .*\.php(\/.*)*$ { root /lzm/work/blog_server/typecho; fastcgi_split_path_info ^(.+?.php)(/.*)$; fastcgi_pass 127.0.0.1:6000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
verify
Fill in the configuration:
If you encounter the following problems, you can check the account number and permissions of the database.
Let's move on: fill in the first user
Successful installation:
Configure Typecho
Click Next in the above figure, let's configure the database. The database can be laid out on this machine or on other devices. This notebook is all done on this machine by default.
add skin
Use joe here:
cd /lzm/work/blog_server/typecho/usr/themes git clone https://github.com/HaoOuBa/Joe.git
Enter the blog site console, click Change Appearance, and enable joe:
Re-enter the site:
https
Of course http is an insecure protocol, so we need to use https to access our blog site.
You can refer to the nginx https chapter.
Here are the results directly:
https has been successfully enabled. The exclamation mark in the picture means that my SSL certificate is a domain name SSL certificate. Here, I use IP to access, and the browser pops up an exclamation mark. My domain name and website are still on record.