Bài đăng

Đang hiển thị bài đăng từ Tháng 8, 2015

Use Your SSH Config File to Create Aliases for Hosts

Hình ảnh
This trick is for Linux and SSH users who often log in to remote systems. Having to type the same info over and over again is mind-numbingly repetitive, but using an SSH config file makes the process much more convenient. It’s pretty easy to turn scp –P 50001 username@remote.sshserver.com:somefile ./somefile ssh –p 50001 username@remote.sshserver.com into something quick: scp remotehost:somefile ./somefile ssh remotehost Aside from specifying port numbers, addresses, and user names, you can specify key files, time out intervals, and tons of other options. All it takes is one little file. Fire up a text editor and point it to this file: ~/.ssh/config Alternatively, you could put the contents and save it to that file, but it’s best to make sure to open it if it already exists. Here’s the basic format of what you need to put (or add to what you have). Replace “your_alias_name” with a short name for this connection. Something like “home,” “work,” or “asdf”

Proxying to FastCGI in Ubuntu/Apache 2.4

Ubuntu 12.04 In Apache under Ubuntu 12.04 LTS, to pass a request off to a FastCGI process (such as PHP-FPM), I usually installed libapache2-mod-fastcgi . It looked something like this: $ sudo add-apt-repository -y ppa:ondrej/apache2 $ sudo apt-key update $ sudo apt- get update $ sudo apt- get install -y apache2 apache2-mpm- event libapache2- mod -fastcgi This was nice as it would allow the use of one configuration file for handling all FastCGI requests. For example, to hand off requests to PHP-FPM. I'd create /etc/apache2/conf-available/php5-fpm.conf :   <IfModule mod_fastcgi.c> AddHandler php5-fcgi .php Action php5-fcgi /php5-fcgi Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization <Directory /usr/lib/cgi-bin> Options ExecCGI FollowSymLinks SetHandler fastcgi-script