ubuntu 13.10 LAMP + PhpMyAdmin 配置

本文详细指导如何在Ubuntu 13.10服务器上安装并配置LAMP服务器组件,包括Apache、MySQL、PHP等,适合初学者参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >



1、安装 LAMP

 文章地址: http://www.unixmen.com/install-lamp-server-apache-mysql-php-ubuntu-13-10-server/

Install LAMP Server (Apache, MySQL Or MariaDB, PHP) On Ubuntu 13.10 Server

WRITTEN BY sk ON OCTOBER 21, 2013. POSTED IN linux tutorialsubuntu

Last Updated on 05 November 2013

LAMP is a combination of operating system and open-source software stack. The acronym LAMP is derived from first letters of Linux, Apache HTTP Server, MySQL database, and PHP, Perl orPython. We already have shown you how to install LAMP on many platforms.

In this tutorial, let us install LAMP server on Ubutu 13.10 Server edition. My testbox hostname and IP address are server.unixmen.com and 192.168.1.101/24, respectively.

Install Apache

Apache is an open-source multi-platform web server. It provides a full range of web server features including CGI, SSL and virtual domains.

To install Apache, enter the following command from your terminal:

sudo apt-get install apache2

Test Apache:

Open your web browser and navigate to http://localhost/ or http://server-ip-address/.

Mozilla Firefox_001Install MySQL

MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases, though SQLite probably has more total embedded deployments

sudo apt-get install mysql-server mysql-client

During installation, you’ll be asked to setup the MySQL root user password. Enter the password and click Ok.

sk@server: ~_002Re-enter the password.

sk@server: ~_003Now MySQL server has been installed.

You can verify the MySQL server status using command:

sudo service mysql status

Sample output:

mysql start/running, process 3901

Note: If you want to use MariaDB instead of MySQL, then follow these steps to install MariaDB on Ubuntu 13.10 server.

Install MariaDB

MariaDB is a drop in replacement for MySQL. It is a robust, scalable and reliable SQL server that comes rich set of enhancements.

First you have to remove existing MySQL packages if any. To completely uninstall MySQL with configuration files, enter the following command:

sudo apt-get purge mysql*

Run the following command to remove unwanted packages.

sudo apt-get autoremove

Now add MariaDB PPA to install it.

Run the following commands to add PPA.

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://mariadb.biz.net.id//repo/5.5/ubuntu saucy main

Update the software sources list and install MariaDB using following commands:

sudo apt-get update 
sudo apt-get install mariadb-server mariadb-client

During installation you will be asked to set mysql ‘root’ user password.

sk@server: ~_001Re-enter password:

sk@server: ~_002You can check the MariaDB version using command:

mysql -v

Sample output:

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 34
Server version: 5.5.33a-MariaDB-1~raring-log mariadb.org binary distribution

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Reading history-file /home/sk/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Check if mariadb is running or not, using the following command:

sudo service mysql status

Sample output:

* /usr/bin/mysqladmin  Ver 9.0 Distrib 5.5.33a-MariaDB, for debian-linux-gnu on i686
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Server version        5.5.33a-MariaDB-1~raring-log
Protocol version    10
Connection        Localhost via UNIX socket
UNIX socket        /var/run/mysqld/mysqld.sock
Uptime:            1 min 53 sec

Threads: 1  Questions: 550  Slow queries: 0  Opens: 314  Flush tables: 4  Open tables: 22  Queries per second avg: 4.867

Install PHP

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely used open-source general purpose scripting language that is especially suited for web development and can be embedded into HTML.

Install PHP with following command:

sudo apt-get install php5 php5-mysql libapache2-mod-php5 

Test PHP

Create a sample “testphp.php” file in Apache document root folder.

sudo nano /var/www/testphp.php

Add the following lines.

<?php
phpinfo();
?>

Restart apache2 service:

sudo service apache2 restart

Navigate to  http://server-ip-address/testphp.php. It will display all the details about php such as version, build date and commands etc.

phpinfo() - Mozilla Firefox_004If you want to install all php modules, enter the command sudo apt-get install php* and restart the apache2 service. To verify for the modules, open web browser and navigate to http://server-ip-address/testphp.php. You will able to see all php modules.

Manage MySQL Databases (Optional)

Install phpMyAdmin:

phpMyAdmin is a free open-source web interface tool used to manage your MySQL databases. It is available in the Official Debian repositories. So install it with command:

sudo apt-get install phpmyadmin

Select the Web server you use, in my case it is apache2.

sk@server: ~_005Select Yes to configure database for phpmyadmin wjth dbconfig-common.

sk@server: ~_006sk@server: ~_007Enter password of the database’s administrative user.

sk@server: ~_008Enter MySQL application password phpmyadmin.

sk@server: ~_009Re-enter the password.

sk@server: ~_010The phpMyAdmin installation has been completed.

Access phpMyAdmin Web Console

Now you can access the phpmyadmin console by navigating to http://server-ip-address/phpmyadmin/ from your browser.

Enter your MySQL username and password which you have given in previous steps. In my case its “root” and “ubuntu”.

phpMyAdmin - Mozilla Firefox_011You will be redirected to PhpMyAdmin main web interface.

192.168.1.101 - localhost | phpMyAdmin 4.0.6deb1 - Mozilla Firefox_012Now you can manage your MySQL databases from phpMyAdmin web interface.

That’s it. Your LAMP server is up and running now
.


2、配置phpmyadmin

按照上面的说明安装phpmyadmin后往往不能正常工作,需要配置一下,网上的解决方式大多是旧版本的。新版本的解决方式可以在ubuntu网站找到。

地址:https://help.ubuntu.com/community/phpMyAdmin

Once phpMyAdmin is installed point your browser to http://localhost/phpmyadmin to start using it. You should be able to login using any users you've setup in MySQL. If no users have been setup, useadmin with no password to login.

Should you get a 404 "Not Found" error when you point your browser to the location of phpMyAdmin (such as:http://localhost/phpmyadmin) the issue is likely caused by not checking the 'Apache 2' selection during installation. To redo the installation run the following:

 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
  • Since Ubuntu 13.10 (Saucy Salamander), Apache no longer loads configuration files from the /etc/apache2/conf.d directory. Instead, they are loaded from the /etc/apache2/conf-enabled directory. Therefore, if you need to manually include the phpMyAdmin-shipped Apache configuration file, you must run the following:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
sudo /etc/init.d/apache2 reload



资源下载链接为: https://pan.quark.cn/s/9e7ef05254f8 行列式是线性代数的核心概念,在求解线性方程组、分析矩阵特性以及几何计算中都极为关键。本教程将讲解如何用C++实现行列式的计算,重点在于如何输出分数形式的结果。 行列式定义如下:对于n阶方阵A=(a_ij),其行列式由主对角线元素的乘积,按行或列的奇偶性赋予正负号后求和得到,记作det(A)。例如,2×2矩阵的行列式为det(A)=a11×a22-a12×a21,而更高阶矩阵的行列式可通过Laplace展开或Sarrus规则递归计算。 在C++中实现行列式计算时,首先需定义矩阵类或结构体,用二维数组存储矩阵元素,并实现初始化、加法、乘法、转置等操作。为支持分数形式输出,需引入分数类,包含分子和分母两个整数,并提供与整数、浮点数的转换以及加、减、乘、除等运算。C++中可借助std::pair表示分数,或自定义结构体并重载运算符。 计算行列式的函数实现上,3×3及以下矩阵可直接按定义计算,更大矩阵可采用Laplace展开或高斯 - 约旦消元法。Laplace展开是沿某行或列展开,将矩阵分解为多个小矩阵的行列式乘积,再递归计算。在处理分数输出时,需注意避免无限循环和除零错误,如在分数运算前先约简,确保分子分母互质,且所有计算基于整数进行,最后再转为浮点数,以避免浮点数误差。 为提升代码可读性和可维护性,建议采用面向对象编程,将矩阵类和分数类封装,每个类有明确功能和接口,便于后续扩展如矩阵求逆、计算特征值等功能。 总结C++实现行列式计算的关键步骤:一是定义矩阵类和分数类;二是实现矩阵基本操作;三是设计行列式计算函数;四是用分数类处理精确计算;五是编写测试用例验证程序正确性。通过这些步骤,可构建一个高效准确的行列式计算程序,支持分数形式计算,为C++编程和线性代数应用奠定基础。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值