标签:des style http color java 使用 os strong
Ctrl+Alt+T
sudo –sH
linux命令ps aux|grep xxx
ln -s 源地址 目的地址
比如把linux文件系统rootfs_dir软链接到/home/jyg/目录下
ln -s /opt/linux/rootfs_dir /home/jyg/rootfs_dir就可以了
find / -name [filename]
apt-get
sudo apt-get install openjdk-6-jdk
sudo apt-get install openjdk-7-jdk
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
sudo vi /etc/environment
#Add following
JAVA_HOME=”/usr/lib/jvm/java-1.6.0-openjdk-i386”
Test:
source /etc/environment
echo $JAVA_HOME
uninstall
sudo apt-get remove openjdk-6-jdk
The easy way to install the last JKD1.7
-- sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
uninstall
sudo apt-get remove oracle-java7-installer
Download JDK
http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz
(you get the permission by access the page: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1637583.html )
cd ~/Downloads
tar –zxcf jdk-7u3-linux-x64.tar.gz
#you will see the folder jdk1.7.0_03, for the same which live ,change the folder name to jdk 1.7.0
mv jdk1.7.0_03 jdk1.7.0
sudo mkdir –p –m ug+rw /usr/lib/jvm/jdk1.7.0
sodu mv jdk1.7.0 /usr/lib/jvm/
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1. 1.7.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1. 1.7.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac //
sudo update-alternatives --config javaws
sudo vi /etc/environment
#Add following
JAVA_HOME=”/usr/lib/jvm/jdk1.7.0”
Test:
source /etc/environment
echo $JAVA_HOME
Notice: If you want to install other version JDK, Please see Install Other JDK
sudo apt-get install nginx
Useful Command about Nginx.
Start Nginx:sudo /etc/init.d/nginx start; // sudo service nginx start
Test: Browser the location:http://localhost ; if browser show "Welcome to nginx!", you have installed Nginx successfully;
Shutdown Nginx:sudo /etc/init.d/nginx stop;
Restart nginx:sudo /etc/init.d/nginx restart;
**You can run the following command to reveal your virtual server’s IP address.
ifconfig eth0 | grep inet | awk ‘{ print $2 }‘
When you visit your IP address page in your browser, you will see the words, “Welcome to nginx”
You can see a screenshot of the utilitarian nginx welcome page here
To ensure that nginx will be up after reboots, it’s best to add it to the startup. Type this command into terminal:
update-rc.d nginx defaults
sudo apt-get install php5-cli php5-cgi php5-fpm php5-mcrypt php5-mysql
php5-fpm:与nginx配合方式之一,另外个是:spawn-fcgi;
php5-mysql:访问mysql;
sudo vi/etc/nginx/sites-available/default
将index的一行修改为:“index index.html index.htm index.php;”
去掉下面的注释用于支持php脚本:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
Nginx 默认站点目录: cd /usr/share/nginx/www
echo "<?php phpinfo();?>" > test.php
启动nginx:
sudo /etc/init.d/nginx start
出现php详细信息,配置成功。
关闭nginx
sudo /etc/init.d/nginx stop
sudo apt-get install mysql-server
安装过程中要求输入用户名秘密. [mysqlUser] /[mysqlPW]
mysql –u [mysqlUser]–p
进入到mysql 控制台.
网站直接下载: http://www.phpmyadmin.net/home_page/downloads.php
Terminal 下载
wget http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-4.2.7-all-languages.tar.gz
保存文件到 /var/lib: sudo mv phpMyAdmin-4.2.7-all-languages.tar.gz /var/lib/phpMyAdmin
cd /var/lib/phpMyAdmin
sudo tar zxvf phpMyAdmin-4.2.7-all-languages.tar.gz
ln –s /var/lib/phpMyAdmin/ phpMyAdmin-4.2.7-all-languages /usr/share/nginx/www/phpmyadmin
访问:http://localhost/phpmyadmin
出现登陆页面, 用mysql 的用户名密度登陆即可.
sudo apt-get install tomcat7 tomcat7-docs tomcat7-examples tomcat7-admin
Choose username and password to manage tomcat and add to /etc/tomcat7/tomcat-users.xml file in the below format.
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="[tomactAdmin]" password="[tomcatPW]" roles="manager-gui,admin-gui"/>
This code must be within this < tomcat-users > …. < / tomcat-users > Tags
Now restart the service.
sudo /etc/init.d/tomcat7 restart
sudo /etc/init.d/tomcat7 stop
sudo /etc/init.d/nginx stop
sudo vi /etc/tomcat7/server.xml
将<Host name="localhost" appBase="webapps" ...>修改为<Host name="localhost" appBase="/usr/share/nginx/www" ...>
sudo vi /etc/nginx/proxy_params
添加:
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
sudo vi /etc/nginx/sites-available/default
修改index行为:“index index.html index.htm index.php index.jsp;”
在"location ~ \.php${...}"php配置节添加:
location ~ \.jsp$ {
index index.jsp;
proxy_pass http://localhost:8080;
include proxy_params;
}
新建目录:sudo mkdir /usr/share/nginx/www/test
新建JSP文件:sudo vi /usr/share/nginx/www /test/test.jsp
输入:
<HTML>
<BODY>
<%
out.println("IP:");
out.println(request.getHeader("x-forwarded-for"));
%>
</BODY>
</HTML>
启动 tomcat: sudo /etc/init.d/tomcat7 start
启动nginx:sudo /etc/init.d/nginx start
访问:http://localhost/test/test.jsp
如有问题 查看tomcat log:
cat /var/log/tomcat7catalina.out |more
出现"IP:192.168.11.22"配置成功。
说明下,因为此处用了nginx代理的功能,所以要用request.getHeader("x-forwarded-for")获得IP;request.getRemoteHost()获得的将是代理的IP,即:127.0.0.1。
sudo apt-get install eclipse-platform
sudo apt-get install eclipse-jdk
--need reconfig java vm
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
主要参考:
http://wenku.baidu.com/view/f1b8592a192e45361066f5ad.html
ubuntu-12.04.2-desktop-amd64 安装整合 nginx + php + mysql + phpmyadmin + tomcat,布布扣,bubuko.com
ubuntu-12.04.2-desktop-amd64 安装整合 nginx + php + mysql + phpmyadmin + tomcat
标签:des style http color java 使用 os strong
原文地址:http://www.cnblogs.com/inLearning/p/3888960.html