Build ss-panel server under Ubuntu 14.04 to manage multi-user Shadowsocks service

Dependency package pre-installed
apt-get install python-pip
apt-get install git
apt-get install build-essential

1. Install Nginx
sudo apt-get update  
sudo apt-get install nginx  
or compile and install Nginx

by yourself 2. Install mysql
sudo apt- get install mysql-server  
set root password during

installation 3. Install php7.0
set language
sudo apt-get install language-pack-en-base  
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php  
installation php
sudo apt-get update  
sudo apt-get install php7.0 php7.0-fpm php7.0-mysql php7.0-gd php7.0-curl php7.0-mbstring php7.0-dom 

4. Install redis
sudo apt -get install redis-server 

5. Install ss-panel and
select the directory /home/deploy to download the installation package
git clone https://github.com/orvice/ss-panel.git  
Enter the directory and use composer to install the required dependencies
cd ss-panel
curl -sS https://getcomposer.org/installer | php  
php composer.phar install  
settings permission, otherwise Slim Application Error will be reported
sudo chmod -R 777 /home/deploy/ss-panel/storage/

6. Initialize the mysql database of ss-panel

mysql -u root -p

mysql>?create database shadowsocks;  
> use shadowsocks;
> source /home/deploy/ss-panel/db.sql;
> flush privileges;
> exit;

7、配置nginx支持php
server {  
    listen 80;
    server_name sspanel.badtom.cn;
    root /home/deploy/ss-panel/public/;
    index index.php index.html index.htm;
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /home/deploy/ss-panel/public/;
    }
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

8. Configure php to enable port monitoring and
enter the directory/ etc/php/7.0/fpm/pool.d/, edit the configuration file www.conf,
cd /etc/php/7.0/fpm/pool.d/
vi www.conf
set the port to listen to
listen 127.0.0.1:9000

9. Modify ss-panel configuration file.env
cp .env.example .env  
vi .env

# database database configuration
db_driver = 'mysql'  
db_host = 'localhost'  
db_port = '3306'  
db_database = 'shadowsocks'  
db_username = 'root'     
db_password = 'yourpassword'  
db_charset = 'utf8'  
db_collation = 'utf8_general_ci'  
db_prefix = '' 

10. Restart nginx, php
nginx -s reload
service php7.0-fpm restart

11. Add administrator account
php xcat createAdmin  

12. Deploy shadowsocks- manyuser
download the installation package
cd /home/deploy/software/
git clone -b manyuser https://github.com/mengskysama/shadowsocks-rm.git  
install cmysql rely on
sudo pip install cymysql  
Enter shadowsocks-rm/shadowsocks directory and modify config. py file for the following
#Config
MYSQL_HOST = 'localhost'  
MYSQL_PORT = 3306  
MYSQL_USER = 'root'  
MYSQL_PASS = 'yourpassword'  
MYSQL_DB = 'shadowsocks' 

13. Start shadowsocks
python servers.py
but this is a non-resident process, you need to install supervisor management

14. Install supervisor service
apt-get install supervisor

Create a new configuration file in the /etc/supervisor/conf.d/ directory, For example, ssmanyuser.conf, the content is as follows:
[program:ssmanyuser]
command=python /home/deploy/software/shadowsocks-rm/shadowsocks/servers.py

user=root


Start the supervisor service
root@~>supervisord
If the prompt is started, kill the supervisor process first.

Start and stop the process
supervisorctl start ssmanyuser
supervisorctl stop ssmanyuser


At this point, the ss-panel and Shadowsocks multi-user server are completed, and Shadowsocks users can be dynamically managed through the front-end page.


Problem solved:

shadowsocks startup reports undefined symbol: EVP_CIPHER_CTX_cleanup error
This problem is due to the abandonment of EVP_CIPHER_CTX_cleanup function in openssl1.1.0.
Modification method:

Open the file with vim: vim /usr/local/lib/python2.7/dist-packages/ shadowsocks/crypto/openssl.py (please modify the path according to your own system conditions, if you don't know where the file is, you can use the find command to find the file location)
Jump to line 52 (shadowsocks2.8.2 version, other versions search Click cleanup) to 
enter edit mode Change line 52 libcrypto.EVP_CIPHER_CTX_cleanup.argtypes = (c_void_p,) to libcrypto.EVP_CIPHER_CTX_reset.argtypes = (c_void_p,) search for cleanup again (there are 2 places in the whole file, here is in line 111), and set Change libcrypto.EVP_CIPHER_CTX_cleanup(self._ctx)  to libcrypto.EVP_CIPHER_CTX_reset(self._ctx) to save and exit Start shadowsocks service: service shadowsocks start or sslocal -c ss configuration file directory Problem solved






Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325683594&siteId=291194637