Last active
October 11, 2015 18:08
-
-
Save rubyonrailsworks/3898898 to your computer and use it in GitHub Desktop.
Ubuntu install guide
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip unzip wget vim build-essential openssl libssl-dev libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxslt-dev libxml2-dev libxslt1-dev autoconf automake libtool imagemagick libpcre3-dev libmysqld-dev libcurl4-openssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To get started, press Ctrl – Alt – Ton your keyboard to open the terminal. When it opens, run the commands below to download the deb package. | |
wget https://launchpad.net/~clipgrab-team/+archive/ppa/+files/clipgrab_3.2.0.9~precise2_i386.deb | |
Next, run the commands below to install ClipGrab. | |
sudo dpkg -i clipgrab* | |
If the above commands fail to install ClipGrab, run the commands below to force the installation. | |
sudo apt-get install -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository ppa:nvbn-rm/ppa | |
sudo apt-get update | |
sudo apt-get install everpad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc: http://chriscant.phdcc.com/2010/11/installing-tomcat-onto-ubuntu-apache2.html | |
This post describes how to install Tomcat 6 on an Ubuntu 10.10 server and connect it up with the Apache2 server using the jk module. Although there are plenty of posts about this, none gave a full list of instructions; this is what I aim to provide - let me know if you have any corrections. | |
I assume that you have Apache2 installed. | |
You will need to do most of the following actions at a root shell prompt. Get this from your login using: sudu su - You will need to edit various text files. You can do this using vi at the shell prompt. However I usually do this on my local computer using my preferred editor, transferring files to and fro using FTP. | |
Installing Tomcat | |
This command gets Tomcat 6 - and Java if need be: | |
aptitude install tomcat6 | |
I'm not sure if that gets all the Tomcat files, so enter this to get them all: | |
apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples | |
On my system, Java was installed to here: /usr/lib/jvm/default-java/ | |
You now need to set up Java environment variables in text script file /etc/environment | |
Add this to the PATH variable: /usr/lib/jvm/default-java/bin after a colon separator. Add these lines: | |
JAVA_HOME=/usr/lib/jvm/default-java | |
JDK_HOME=/usr/lib/jvm/default-java | |
You will now need to reboot so these changes are used. | |
Tomcat should now be running. You can start, stop or restart it as follows: | |
/etc/init.d/tomcat6 stop | |
/etc/init.d/tomcat6 status | |
/etc/init.d/tomcat6 restart | |
or more easily like this: | |
service tomcat6 restart | |
Tomcat should now be running on port 8080 at your host, eg http://www.example.com:8080/ If you go there, you should see an It works page. To test it further, I put a JSP file in here: /var/lib/tomcat6/webapps/ROOT/ and saw that it ran OK. I then put a servlet WAR file in /var/lib/tomcat6/webapps/. This was soon expanded automatically by Tomcat and I was able to navigate to the servlet directory (still on the 8080 port). | |
You may find it useful to run the manager and host-manager Tomcat applications. To enable these you need to edit the Tomcat configuration files in /etc/tomcat6/. Edit tomcat-users.xml to include the following: | |
<role rolename="manager"/> | |
<role rolename="admin"/> | |
<user name="admin" password="secret_password" roles="manager,admin"/> | |
You should now be able to access these apps at /manager/html and /host-manager/html. You will need to enter your credentials; possibly a couple of times on first access. | |
The Tomcat logs are at /var/log/tomcat6/. By default Tomcat creates a different log file for each day. Keep an eye on these, and the disk space they consume. | |
Connecting Tomcat to Apache | |
Hopefully you already know these commands to test your Apache configuration and restart Apache. You'll need these later. | |
apache2ctl configtest | |
apache2ctl restart | |
First, tell Tomcat to listen out for connections from Apache. Edit /etc/tomcat6/server.xml to uncomment this line: | |
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> | |
Restart Tomcat. | |
Install the jk module that acts as the connector between Apache and Tomcat: | |
apt-get install libapache2-mod-jk | |
You should see a file called jk.load in /etc/apache2/mods-available/. I edited this to contain: | |
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so | |
JkWorkersFile /etc/libapache2-mod-jk/workers.properties | |
JkLogFile /var/log/apache2/mod_jk.log | |
JkShmFile /var/log/apache2/jk-runtime-status | |
JkLogLevel info | |
You can also add JkMount instructions here, but I found that I needed to put them in each VirtualHost file in /etc/apache2/sites-available/. Eg in my default VirtualHost file I added: | |
JkMount /*.jsp ajp13_worker | |
JkMount /manager ajp13_worker | |
JkMount /manager/* ajp13_worker | |
JkMount /host-manager ajp13_worker | |
JkMount /host-manager/* ajp13_worker | |
An alternative is to define JkMount commands in jk.load and add a JkMountCopy command to copy these settings to all virtual hosts. | |
You now need to edit the jk worker file /etc/libapache2-mod-jk/workers.properties. Make sure it has code as follows, ie to tell jk to use the Tomcat connection we defined earlier: | |
worker.list=ajp13_worker | |
worker.ajp13_worker.port=8009 | |
worker.ajp13_worker.host=localhost | |
worker.ajp13_worker.type=ajp13 | |
Restart apache. | |
I was now able to access the Tomcat manager here: http://www.example.com/manager/html. | |
Edit your other VirtualHost files to expose any other apps that you need. | |
You'll find the Apache and jk logs in here: /var/log/apache2/. As above, keep an eye on these files and the disk space they use. | |
If you see "missing uri map" in log file mod_jk.log then you need to define JkMount in your VirtualHost. | |
As a final task, if you wish, disable the Tomcat 8080 port by editing /etc/tomcat6/server.xml and then restart Tomcat. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
第一步: | |
sudo dpkg-reconfigure -plow phpmyadmin | |
Then select Apache 2 for the webserver you wish to configure. | |
第二步:(非必须) | |
If this does not work, then you can do the following to include the phpMyadmin-shipped Apache configuration into Apache: | |
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf | |
sudo /etc/init.d/apache2 reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mongo | |
sudo apt-get install php5 php5-dev php5-cli php-pear libcurl3-openssl-dev | |
pecl install mongo | |
echo "extension=mongo.so" >> /etc/php5/apache2/php.ini | |
cd /var/www && wget http://rock-php.googlecode.com/files/rockmongo-v1.1.0.zip && unzip rockmongo-v1.1.0.zip -d rockmongo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When you install or upgrade to Ubuntu 12.04, you’ll notice that screensaver has been removed. Now a blank (dark) screen will kick in when your computer is idled. In previous versions of Ubuntu, when your computer becomes idled, a screensaver will start and begin displaying different patterns on your display. Not anymore. If you want to add or enable screensaver package in 12.04, then you must continue below to learn how to do it. | |
remove gnome-screensaver package. | |
sudo apt-get purge gnome-screensave | |
Next, run the commands below to install xscreensaver packages | |
sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra | |
Next, run the commands below to create xscreensaver autostart file. | |
sudo gedit /etc/xdg/autostart/screensaver.desktop | |
Restart and you’re done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@AY1210150342185b33738:~# sudo apt-get install mailutils sharutils sendmail sendmail-cf squirrelmail spamassassin mailman | |
sendmail 默认只会为本机用户发送邮件,只有把它扩展到整个Internet,才会成为真正的邮件服务器。 | |
打开sendmail的配置宏文件:/etc/mail/sendmail.mc | |
找到如下行: | |
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl | |
修改Addr=0.0.0.0 ,表明可以连接到任何服务器。 | |
生成新的配置文件: | |
#cd /etc/mail | |
#mv sendmail.cf sendmail.cf~ //做一个备份 | |
#m4 sendmail.mc > sendmail.cf //>的左右有空格,提示错误没有安装sendmail-cf | |
# TEST | |
mail -s test [email protected] < sendmail.cf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-ffmpeg libavcodec-extra-53 libavdevice-extra-53 libavfilter-extra-2 libavformat-extra-53 libpostproc-extra-52 libswscale-extra-2 libdvdread4 x264 flac faac lame twolame adobe-flashplugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
设置local_enable为YES可以开放系统用户访问FTP。 | |
在系统里面添加用户,将shell设置为/bin/false,并将其家目录若设置为/home/ftp或者其他目录。这样就可以建立只访问FTP而无法 登录shell环境的用户。 | |
注意:可以新建一个ftp组,把/home/ftp的所有者设为ftp,群组也设为ftp。然后所有新添加的FTP用户只需加入到FTP群组就可以具有对 /home/ftp的访问权限了。这样也方便管理用户量比较大的FTP系统. | |
sudo addgroup ftp #如果有了就不用添加 | |
sudo chown ftp:ftp /var/www/docs #如果改过了就不用再改 | |
sudo adduser –shell /bin/false –home /var/www/docs ftpuser1 #添加用户user1 | |
sudo usermod -aG ftp ftpuser1 #把用户user1加入到ftp组 | |
可以通过local_root、anon_root来指定相应的默认目录。 | |
将chroot_local_user与chroot_list_enable都设置为YES。这样就只有chroot_list_file所指定的文件 里面的用户列表可以访问默认目录以外的目录,而列表以外的用户则被限定在各自的默认目录活动!如果某些特定用户需要访问其他目录的权限,只需将其用户名写 入chroot_list_file文件就可以赋予其访问其他目录的权限! | |
local_umask=077 | |
xferlog_file=/var/log/vsftpd.log | |
vsftpd on Ubuntu server 530 login incorrect error – fixed | |
sudo apt-get remove vsftpd | |
sudo rm /etc/pam.d/vsftpd | |
sudo apt-get install vsftpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository ppa:relan/exfat | |
sudo apt-get update | |
sudo apt-get install fuse-exfat | |
sudo mkdir /mnt/exfat | |
用磁盘实用工具,找到U盘的设备号,比如是sdc1 | |
sudo mount.exfat-fuse /dev/sdc1 /mnt/exfat | |
Now we are able to manualy mount exFAT-formatted drives. To make it automatical we’ll need to install couple more things: | |
apt-get install build-essential | |
apt-get install ncurses-dev | |
apt-get install util-linux | |
Linux (or Ubuntu, in particular) comes with support for many file systems. If you plug in your USB drive, chances are your Linux system will recognize it immediately and mount it in your file manager. However, if your external hard disk is in the exFAT format, your system won’t be able to detect it since it doesn’t support it natively. Here is how you can access, with read and write permission, to an exFAT file system in Ubuntu. | |
Installation | |
The Ubuntu repository does not come with any package that supports exFAT. To enable access to exFAT, we need to install from a third-party PPA. | |
In your terminal, | |
sudo add-apt-repository ppa:relan/exfat | |
sudo apt-get update | |
sudo apt-get install fuse fuse-exfat exfat-utils | |
Note: The PPA is supported from Lucid (10.04) to Precise (12.04). It is not supported in Quantal (12.10) yet. | |
Usage | |
Once you have installed the exfat-utils packages, whenever you plug in your exFAT external drive. It will be detected by the system and automount. It comes with read/write access so you can copy to and paste from the drive. | |
In the event that your system doesn’t automount the external drive, here is what you can do to mount it manually: | |
sudo mkdir /media/exfat | |
sudo mount -t exfat /dev/sdb1 /media/exfat | |
Replace the “/dev/sdb1″ with the exact file path to your external hard drive. | |
To unmount the exFAT external drive: | |
sudo umount /media/exfat | |
Why isnt’t exFAT supported natively in Linux? | |
The main reason why exFAT is not supported natively in Linux is because exFAT is developed by Microsoft and it comes with a restrictive license, which doesn’t allow free or open-source operating system to implement it natively. | |
Even though the exfat-utils package allows you to read/write to a exFAT file system, you can’t format your external hard disk to exFAT format yet. To format to exFAT file system, the only (and easiest) way now is via Windows. If you are running a Windows virtual machine, you can do so in the VM as well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment