Last update at :2024-02-29,Edit by888u
Nowadays, some public short URLs have been deactivated, and some will block personal URLs and cannot generate short URLs. Today I will introduce to you a php+mysql short URL program YOURLS. There are still many short URL programs on the market. , YOURLS is currently updated relatively frequently, and it also supports the latest version of PHP. Today is a complete tutorial for beginners, because using the One Pagoda panel, everything is visual, and it can be easily installed by friends who are just getting started.
Preparation
1. One Xiaoji, the configuration is not limited, as long as the pagoda panel can be installed. Pagoda Linux panel installation tutorial
2. Prepare a domain name. Because it is a short URL, you can choose a two-letter suffix, such as PW, CO, etc. Click to purchase a CO domain name with an annual payment of $1.99
3. Download the YOURLS program. https://github.com/YOURLS/YOURLS/releases a>
Installation and configuration tutorial
Before installation, please note that the program no longer supports php7.2 and below versions. Please pay attention when selecting the PHP version when installing the pagoda.
1. First create a new website
My PHP version is purely static here, because PHP is still being installed and can be selected later. In addition, you need to create a new database and build it directly in phpmyadmin
2. Install and configure YOURLS
Enter the directory where you created this site, upload the YOURLS program you downloaded, and then unzip it. You should see a YOURLS-1.8 folder. Just cut all the files in it to the root directory. Finally, you will see The interface is as follows:
Then when we enter the user directory, we will see a config-sample.php file. We rename this file to config.php and then open it. We need to change some information and fill in your newly created database information below. .
/** MySQL database username */ define( 'YOURLS_DB_USER', 'your db user name' );//user name /** MySQL database password */ define( 'YOURLS_DB_PASS', 'your db password' );//Password /** The name of the database for YOURLS ** Use lower case letters [a-z], digits [0-9] and underscores [_] only */ define( 'YOURLS_DB_NAME', 'yourls' );//data nameThen there is also some site configuration information
define( 'YOURLS_SITE', 'http://your-own-domain-here.com' );//Set your domain name define( 'YOURLS_LANG', '' );//Set the language, which will be used in Chinese translation later define( 'YOURLS_COOKIEKEY', 'modify this text with something random' );//Set cookies, which can be generated by visiting https://api.yourls.org/services/cookiekey/1.0/ $yourls_user_passwords = [ 'username' => 'password', // 'username2' => 'password2', // You can have one or more 'login'=>'password' lines ]; //Set the background username and passwordMost of the configuration has been completed here. We are using Nginx, so pseudo-static rules need to be filled in.
location/{ try_files $uri $uri/ /yourls-loader.php?$args; }After setting up the pseudo-static, we can install it. Enter in the browser: your domain name/admin
Then the installation interface will appear, click Install YOURLS to install
The login interface will appear after the installation is successful. Log in according to the username and password you set above. The following is what it looks like. Yes, it's in English.
Chinese tutorial
There is already a Chinese file provided by a big guy on github. We can download it directly. Download address: yourls-zh_CN
Download to this site, unzip it, and upload zh_CN.mo and zh_CN.po to the user/languages directory.
Then go to config.php to modify the information
define( 'YOURLS_LANG', 'zh_CN' );//It was blank before, change it to zh_CNAfter making the changes, save it and you will see the following interface, which has been Chineseized.
Recommended site searches: host space, jsp space, domain name valuation query, independent IP space, how to query IP address, US host rental, domain name registration information query, Taiwan host, dynamic IP dialer anti-complaint server,
发表评论