ubuntu12.04和14.04安装和常用工具安装

    ubunto 12.04 安装

前言:此为原帖,装载请注明来源。本帖说名了ubuntu12.04和14.04系统安装,firefox,opera,谷歌浏览器的安装,flashplayer的安装,国际版QQ的安装,netbeans的安装,phpmyadmin的安装等。

安装前说明:ubuntu14.04的php默认版本是5.5,php5.5版本较5.3,5.4有大的改动,本人亲测,装了5.5之后,有很多的项目都挂了,保守起见,目前还是安装12.04版比较好。虽然有点古老了,现在都2016年了,但是没办法,不能放弃以前的项目啊,试过装了14.04后,编译安装php5.3,由于要下很多支持包,页比较麻烦,还是重装了系统,到12.04版。

1.安装apache2
  sudo apt-get install apache2

2.开启mod_rewrite模块,开启apache模块mod_vhost_alias
  sudo a2enmod rewrite
  sudo service apache2 restart(重启apache)
  sudo a2enmod
  vhost_alias(开启apache模块mod_vhost_alias)
  sudo service apache2 restart(重启apache)

3.安装php5
  sudo apt-get install php5
  sudo apt-get install php5-gd(gd库)
  sudo apt-get install libapache2-mod-php5(配置apache+php)
  sudo apache2ctl restart(重启apache)
  或者输入sudo /etc/init.d/apache2 restart(重启apache).
  如果用命令:sudo /etc/init.d/apache2 restart重启apache时,报错:Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
  只要在/etc/apache2/apache2.conf 中添加 ServerName localhost 即可

4.安装vim编织器
   sudo apt-get install vim

5.创建工作目录,默认在/var/www/html下,我们修改下,比如当前用户名为jams
cd ~

cd /home/jams
创建www目录,用他作为默认目录
  sudo mkdir www
6.设置默认目录
  cd /etc/apache2/sites-enabled
  sudo vim 000-default(用vim编织器打开000-default文件)
  里面所有注释 然后前面加上:
  <Virtualhost *:80>
        VirtualDocumentRoot "/home/jams/www/www/%0"
        <Directory "/home/jams/www">
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/vhost.error.log
  </Virtualhost>
后面的全部加#注释
重启apache sudo /etc/init.d/apache2 restart

7.检测虚拟机和php apache是否安装成功
  cd www
  sudo mkdir ceshi
  ln -s ceshi www.ceshi.com
  cd ceshi
  sudo vim index.php
    输入:

<?php
        phpinfo();

?>
  保存退出
  现在访问域名(www.ceshi.com)有了,域名指向的目录也有了(/home/jams/www/ceshi 默认会进index.php),那么就需要设置虚拟主机了。

8.设置虚拟主机
  sudo vim /etc/hosts
    加入一行:127.0.0.1        www.ceshi.com

    如:
    127.0.0.1       localhost
    127.0.1.1       jams-Vostro-3900
    127.0.0.1        www.ceshi.com
    192.172.1.168   svn
  保存退出重启apache
www.ceshi.com 就是要访问的域名,如果你在公司有svn,可以加上你们公司的svn号,像我 这里192.172.1.168   svn,如果没有,自己玩,就不要这一行。
我们用浏览器访问:www.ceshi.com,就能看到phpinfo函数打印出来的信息了。

9.安装mysql
  sudo apt-get install mysql-server(密码自己设置,数据库密码最好设置,有些人觉得是本地,为了方便,而把数据库密码设置空,但是又时候操作一些数据时,没有密码是很头疼的)
  sudo apt-get install php5-mysql
  sudo apt-get install libapahce2-mod-auth-mysql(此为让apache php 支持mysql)

再访问www.ceshi.com,看看是否有mysql


10 短标签和上次文件大小限制的修改
(1)
修改系统支持段标签
打开php.ini文件 可用locate php.ini查找所在目录位置
进去后,扎到short_open_tag 将off改为on
short_open_tag = On
(2)
上传文件大小修改 更具需要设置,我这里设置为512M
upload_max_filesize = 512M


到此系统算基本配好了。接下来需要完善一些配置,和装些常用开发工具。

1.安装svn
   sudo apt-get install subversion

2.安装fpt
sudo apt-add-repository ppa:n-muench/programs-ppa
sudo apt-get update
sudo apt-get install filezilla
或在ubuntu软件中心找filezilla,直接安装
启动:命令输入:filezilla

3.安装phpmyadmin
   (1)安装phpmyadmin
      sudo apt-get install phpmyadmin

   (2)配置phpmyadmin
      [1]. sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/sites-available/phpmyadmin
           (这样我们就把phpmyadmin中的apache.conf(apache配置文件)复制到apache2/sites-available下的phpmyadmin文件下。)
      [2]. cd /etc/apache2/sites-enabled/
           (进入sites-enabled文件夹下:)
      [3]. sudo ln -s ../sites-available/phpmyadmin
           建立一个通往配置文件的链接以便能利用它
   (3)重启apache2
      sudo /etc/init.d/apache2 restart

   (4)浏览器打开http://localhost/phpmyadmin

   ubuntu 14.04 做以上操作不能启动phpmyadmin
   还需要做如下处理:
   sudo ln -s /usr/share/phpmyadmin/ /var/www/   我这里是:sudo ln -s /usr/share/phpmyadmin/ /home/chengwen/www/www/   工作目录
   或者将phpmyadmin直接复制到/var/www
   然后在软链接里可以看到:phpmyadmin -> /usr/share/phpmyadmin/
   最后在sudo vim /etc/hosts      
   填写 127.0.0.1 phpmyadmin
   
   phpmyadmin 修改cookie时间 1440
cd /usr/share/phpmyadmin/libraries
sudo vim config.default.php
$cfg['LoginCookieValidity'] = 1440;
我修改成:$cfg['LoginCookieValidity'] = 10800;

注意:$cfg['LoginCookieValidity']的值不能大于php.ini里的session.gc_maxlifetime的值,否则phpmyadmin 里会出现“您的 PHP 配置参数 session.gc_maxlifetime (外链,英文) 短于您在 phpMyAdmin 中设置的 Cookies 有效期,因此您的登录会话有效期将会比您在 phpMyAdmin 中设置的时间要更短。”错误。
因此打开php.ini(用locate pho.ini命令 查找到他)文件,将
session.gc_maxlifetime = 1440
修改为:
session.gc_maxlifetime = 10800

4.安装NetBeans开发编辑工具 (我现在用的是8.1汉语版,8.1以前的还要安装jdk,比较麻烦,而8.1的版本捆绑了jdk,下载后,直接sh 文件包就可以安装)
  先下载netbean安装包,https://netbeans.org/downloads/ 语言选择中文简体,php版64位的
解压得到 xxx.sh文件
  比如我放在终端目录的下载文件目录里面,在终端输入:
  sh /下载/xxx.sh  回车就可以安装了

5.安装谷歌浏览器
先去官网http://www.google.cn/chrome下载:google-chrome-stable_current_i386.deb(包)
或者太平洋下载:http://dl.pconline.com.cn/download/56757-1.html
再使用命令安装:
代码:
sudo apt-get install libxss1(一般需要这个依赖关系,我所先安装libxss1)
sudo dpkg -i google-chrome-stable_current_i386.deb

然后命令输入:google-chrome-stable 启动

如果启动不了,再用命令修复库的依赖:
代码:
sudo apt-get -f install

安装后桌面是没有的,进入终端输入启动命令:google-chrome-stable
启动成功后,会在桌面左边出现快捷按钮,右键,然后锁定启动器。

6.安装Curl
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
sudo /etc/init.d/apache2 restart

7.安装ssh
sudo apt-get install ssh

8.安装firefox  ubuntu默认自带了firefox(版本是31.0版),版本比较低,如果想要更高的版本,可按下面方法装。
首先是官方网下载Firefox的Linux平台包。地址为:http://www.firefox.com.cn/download/ ,找到最新的Linux版本,下载后得到Firefox-latest.tar.bz2,解压到本地,我这里下的linux 中文 linux 64-bit版本
先解压,命令:tar -xvf Firefox-latest.tar.bz2
得到一个Firefox文件夹。然后更改一下用户的执行权限,
命令:cd firefox
sudo chmod 755 *

为了便于管理(当然根据个人的习惯),将此文件夹移到/opt文件夹下面,
命令:sudo mv firefox /opt
此时你若直接运行文件夹中的firefox的话, 弹出的仍然是旧版本的Firefox,所以为了方便使用,还需要更改一下/usr/bin/firefox的指向,先备份该文件(老的不删除,如果发现新的不如老的好用,还可改回来),
命令:sudo mv /usr/bin/firefox /usr/bin/firefox-old
然后创建新文件:
命令: sudo ln -s /opt/firefox/firefox /usr/bin/firefox

执行成功后,关闭firefox,重新打开,如果还是老版本,注销一下,重新登录后
如果左边工具栏没有,可用命令:firefox   启动 然后锁定到工具栏

修改语言(这个在网上搜的,测试过,但是没有成功,建议下载的时候直接选择中文包下载,就不用再来改语言版本了):
浏览器打开:http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6/linux-i686/xpi/
找到zh-CN.xpi(可用ctrl+f 输入:zh-CN.xpi进行查找锁定)
找到后,点击 zh-CN.xpi 浏览器输入框左侧会弹出框,点击Allow,就可以安装中文语言了

9.安装wineQQ国际版
wineQQ国际版 教程:http://www.bubuko.com/infodetail-343048.html
下载地址:http://yun.baidu.com/share/link?shareid=2983202140&uk=202032639
一:安装依赖库
在终端输入
sudo apt-get install  libgtk2.0-0:i386
另外,如果是64位系统还要安装ia32-libs,
但是Ubuntu14.04中该软件包已经被其他版本替代,
所以这里我们选择安装lib32ncurses5,
因此在终端输入
sudo apt-get install lib32ncurses5

二:解压并安装wineqqintl
解压(三个.deb压缩包)放到你的软件目录/home/chengwen/soft/wineqq,我的是/home/chengwen/soft
进入/home/chengwen/soft/wineqq
安装 wine-qqintl_0.1.3-2_i386.deb
终端输入:
sudo dpkg -i wine-qqintl_0.1.3-2_i386.deb
但是我在安装中发生了错误,原因是还有lib没有配置,所以再输入
sudo apt-get install -f
然后再重新输入
sudo dpkg -i wine-qqintl_0.1.3-2_i386.deb
然后便会发现安装正常了。
之后再继续输入
sudo dpkg -i ttf-wqy-microhei_0.2.0-beta-2_all.deb

sudo dpkg -i fonts-wqy-microhei_0.2.0-beta-2_all.deb
将剩余的两个deb包安装

三:运行wineqqIntl
为检测wineqqIntl已正常安装,我们可以输入
sudo dpkg -l|grep qq
然后就会显示你所有的qq安装版本
wineqqIntl默认安装路径为/usr/share/applications/ 当中,当然你也可以输入
sudo find / -name qq*命令在终端中查找qq的有关安装信息
双击“QQ国际版”图标即可正常启动,如果没有图标,用命令:wine-qqintl启动


10.安装flashplayer  如果想用ubuntu电脑看电脑,得装flashplyer才行,下面给出安装方法
(1)打开:https://get.adobe.com/flashplayer/?loc=cn
浏览器会自动检测你的系统信息,
我这次选择的版本是: 11.2.202.616   系统要求:Linux 64-bit, 语言:简体中文, Firefox,选择.tar.gz下载
下载软件包 install_flash_player_11_linux.x86_64.tar.gz

(2)解压:tar -zxvf install_flash_player_11_linux.x86_64.tar.gz

(3)安装Adobe Flash Player:
将libflashplayer.so拷贝到Firefox的Plugin目录:
sudo cp libflashplayer.so /usr/lib/mozilla/plugins/

将usr目录下的所有文档拷贝到系统的/usr目录下:
sudo cp -r ./usr/* /usr/
测试:http://www.linuxidc.com/Linux/2010-12/30642p4.htm
显示:
Your Flash Player version is
LNX 11,2,202,243
Your browser is Gecko engine (Mozilla, Netscape 6+ etc.) on the Linux platform.
安装成功,可以看视频了。


11 安装opera浏览器 如果喜欢opera浏览器,可以安装opera
(1)下载软件包:http://www.opera.com/zh-cn/computer/linux 
得到软件包:opera-stable_37.0.2178.32_amd64.deb
(2).将软件包拷贝到你安装软件的目录如我这:mv /home/chengwen/下载/opera-stable_37.0.2178.32_amd64.deb  /home/chengwen/soft/
(3).安装
cd /home/chengwen/soft
sudo dpkg -i opera-stable_37.0.2178.32_amd64.deb
安装中会弹出一个框,选择是,按enter
(4).启动,在命令中输入opera启动,启动后,锁定在左边工具栏目


12.安装用于打开.chm文件 的软件
sudo apt-get install chmsee
或者
sudo apt-get install xchm

chmsee和xchm都行,2选1,我一般选择安装chmsee


ubuntu 14.04 安装
这个版本和12.04版本大致相同,安装方法参考12.04,只是安装后,需要做些调整。
 基本安装后,安装补充。
1
打开文件: sudo vim /etc/apache2/sites-enabled/000-default.conf
将原来的文件注释,并加入自定义的工作目录命令,如:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmasterg@localhost
        DocumentRoot /home/chengwen/www/www

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>
修改为:
<VirtualHost *:80>
        VirtualDocumentRoot "/home/jams/www/www/%0"
        <Directory "/home/jams/www/">
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/vhost.error.log
</VirtualHost>
#<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        #ServerAdmin webmasterg@localhost
        #DocumentRoot /home/chengwen/www/www

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        #ErrorLog ${APACHE_LOG_DIR}/error.log
        #CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
#</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

保持退出
说明:/home/jams/www 是我放项目的目录,/home/jams/www/www 是我放软链接(域名)的目录

2
2.1
打开文件
sudo vim /etc/apache2/apache2.conf
找到:
<Directory /var/www/html>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/html>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
修改
<Directory /home/jams/www/www>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

2.2
在apache2.conf文件的最上面开始位置,加上下面3行
LoadModule php5_module        /usr/lib/apache2/modules/libphp5.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

重启apache

3 修改 phpmyadmin 的修改在安装12.04的时候做了说明了,返回上面去查看修改。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值