Suse LAMP setup
This page will describe the steps you have to take to install LAMP, which stands for Linux Apache MariaDB PHP. This page will show you, how to set up a working Apache2 webserver, a configured MariaDB database server, to install PHP5, working with Apache, and finally, phpMyAdmin with a configured pmadb database.
Contents
[hide]
This article is updated to reflect the installation in openSUSE 13.1. However it it does not deviate much from lower versions of openSUSE.
Getting root access
Every time you want to change anything to the system, you will need root access. You can get this by:
- Open a command line program (konsole is the standard one).
- Type
su -
The console will now ask you for the password you selected at the installation, enter that password and press enter again. If you logged in successfully, the user name and the computer name should be displayed in red now.
Setting up Apache2
Installing Apache2
To install software, make sure that you have root access. We will install our software using YaST from the command line.
- Open a console.
- To install apache, we use the command
yast -i apache2
or
zypper in apache2.
This also installs the packet apache2-example-pages, which provides an example page when accessing the web server.
Starting Apache2
To start Apache, execute
Note: If you ever want to restart apache, execute
or if you want to stop it
This does not start the apache server after a reboot. To enable that, give the command
Testing the installation
Now that you have installed apache2, you want to check if it works. The packet apache2-example-pages installed the file /srv/www/htdocs/index.html, which contains:
Note: You can create a new file and edit it by using your favorite editor.
You can now start your favorite browser. Navigate to 'localhost'. You should see 'It works!'.
Enabling public access to the web server
In this state the web server is only accessible as localhost. You have to open port http (=80) in the firewall. You can do that using YaST, selecting Security and Users --> Firewall --> Allowed services and add HTTP server. You may also edit the line with FW_CONFIGURATIONS_EXT= in it in the file /etc/sysconfig/SuSEfirewall2 and add apache2 in that line. A space is used in that line to separate elements. After editing you have to restart the firewall using:
Setting up PHP5
Installing PHP5
To install software, you need root access. When you have root access, execute
or
Don't forget to enable mod-php by executing
Now you have installed PHP5.
Restarting the webserver
Now that you have installed PHP5, you have to restart the apache2 webserver to get some results. You can restart apache by executing
with root access.
Testing the installation
That was pretty easy, but now you want to test it out, don't you? So, we go to the htdocs folder again by executing
Make a new file named index.php and with the following content:
Now, open your favorite browser again and navigate to 'localhost/index.php'. If everything went alright then you should see 'You successfully installed PHP5!'.
Setting up MariaDB
Installing MariaDB
We need to install mariadb and mariadb-tools, mariadb-tools is necessary for the administration, execute
or
with root access.
Starting the MariaDB server
MariaDB is an alternative package for MySQL, so further on the name mysql is used.
To start the MariaDB server, execute
You may want to read the messages issued by the server in /var/log/messages.
Note: If you ever want to restart mysql, execute
or if you want to stop it
This does not start the mysql server after a reboot. To enable that, give the command
Configuring the MariaDB/MySql server
To set the root password for the first time:
- Execute
mysqladmin -u root password NEWPASSWORD
- If you want to set the password to root123, type
mysqladmin -u root password root123
- If you want to set the password to root123, type
If you ever want to change your password later:
- Type
mysqladmin -u root -p password NEWPASSWORD
- Your old password will be asked.
Logging in to the client
Now you can log in into the server client by executing
Enter
to go back to the terminal.
Installing phpMyAdmin
What is phpMyAdmin?
phpMyAdmin, or pma is a tool to administrate your databases. The installation process is quite easy.
Installing phpMyAdmin
Install phpMyAdmin by executing
or
This also installs a number of needed php5 modules and restarts the apache2 server.
Logging into phpMyAdmin
To log in to phpMyAdmin:
- Navigate to localhost/phpMyAdmin
- Enter the root username and the root password of your mysql server
- Click on the 'go' button
Configuring phpMyAdmin
To configure phpMyAdmin, we need to edit the configuration file. It is found in /etc/phpMyAdmin/config.inc.php.
- Open the file and change corresponding lines to (note the double underscore in the names of the tables):
- $cfg['Servers'][$i]['controluser'] = 'somename';
- $cfg['Servers'][$i]['controlpass'] = 'somepassword';
- /*Advanced phpMyAdmin features */
- $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
- $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
- $cfg['Servers'][$i]['relation'] = 'pma__relation';
- $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
- $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
- $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
- $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
- $cfg['Servers'][$i]['history'] = 'pma__history';
- $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
- $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
- You will need to change the user name of controluser to the name of a new account (above somename) and controlpass (above somepassword) to it's password.
- Change the protection of this file so it is owned by root and only readable by group www.
chown root:www /etc/phpMyAdmin/config.inc.phpchmod 640 /etc/phpMyAdmin/config.inc.php
- Log in to localhost/phpMyAdmin again.
- Import via the Import tab on the phpMyAdmin page the file /usr/share/doc/packages/phpMyAdmin/example/create_tables.sql There is a comment telling you that a user pma should be present already, however this is not necessary.
- Log in and out again using user name root and the root password of MySQL.
- Select the tab Users and press Add user. Enter as new user name the name of controluser chosen above, localhost as host, twice the above chosen password in the corresponding fields and press Go (below right).
- Create a file with the following content, where somename and somepassword are replaced by the above chosen values.
- GRANT USAGE ON mysql.* TO 'somename'@'localhost' IDENTIFIED BY 'somepassword';
- GRANT SELECT (
- Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
- Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
- File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,
- Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,
- Execute_priv, Repl_slave_priv, Repl_client_priv
- ) ON mysql.user TO 'somename'@'localhost';
- GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
- ON mysql.tables_priv TO 'pmagebruiker'@'localhost';
- GRANT SELECT ON mysql.db TO 'somename'@'localhost';
- GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'somename'@'localhost';
and import that file via the Import tab.
- Read the documentation on phpMyAdmin on the phpMyAdmin website.
- Do not forget to take the necessary security measures.
- You should have a working LAMP server now!
==================================================================
https://en.opensuse.org/SDB:LAMP_setup
https://en.opensuse.org/SDB:Linux_Apache_MySQL_PHP
http://os.51cto.com/art/201203/323578.htm
http://www.unixmen.com/install-lamp-server-apache-mariadb-php-opensuse-13-213-1/
http://ben-it.org/content/open-suse-123-install-lamp-server
Suse LAMP setup的更多相关文章
- Ubuntu 16.04 LAMP server tutorial with Apache 2.4, PHP 7 and MariaDB (instead of MySQL)
https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-16-04-lamp/ This tut ...
- openSUSE 安装LAMP记录
按照 openSUSE SDB:LAMP setup安装好了LAMP.运行的大多数命令都是来自与openSUSE SDB:LAMP setup中. 本页面描述如何安装LAMP,这是 Linux Apa ...
- How To Install Development Tools In Linux
In this brief tutorial, we will be discussing how to install development tools in popular Linux di ...
- How to install cacti on centos 6
Cacti – Network and performance monitoring tool Cacti is one of best monitoring tool used to monit ...
- 用于 ‘Suse‘ Linux 包管理的 Zypper 命令大全
SUSE( Software and System Entwicklung,即软件和系统开发.其中‘entwicklung‘是德语,意为开发)Linux 是由 Novell 公司在 Linux 内核基 ...
- suse最小化安装
Open suse 图形安装 用虚拟机vmware70 或者是Oracle VM VirtualBox安装 .镜像文件就是SLED-10-x86_64-DVD1 根据虚拟机设置吧镜像文件装入虚拟机中 ...
- 7. LAMP环境搭建
一.准备工作 1.安装编译工具gcc.gcc-c++ 注意解决依赖关系,推荐使用yum安装,若不能联网可使用安装光盘做为yum源-- 1)编辑yum配置文件: # mount /dev/cdrom / ...
- lamp php的ssl,ssh支持
Php支持ssl,ssh扩展: 准备:可以成功解析php 1.curl的安装 [root@localhost~]# cd /usr/local/src/ [root@localhost~]# wget ...
- 【Mail】搭建邮件服务器(LAMP+Postfix+Dovcot+PostfixAdmin+Roundcubemail)
大纲 一.mail部署说明 二.安装准备 三.LMAP环境配置 四.配置postfixadmin 五.配置postfix 六.配置dovecot 七.测试SMTP和POP3服务 八.配置Roundcu ...
随机推荐
- MySQL保留字冲突 关键词:保留字, 关键字
在Mysql中,当表名或字段名乃至数据库名和保留字冲突时,在sql语句里可以用撇号`(Tab键上方的按键)括起来. 注意,只有保留字需要``括起来,非保留字的关键字不需要. MySQL 8.0 官方文 ...
- pip和conda安装源更改
pip和conda安装源更改 python模块安装,使用国内源可以提高下载速度. pip源更改: pip源有好几个,我一直用的清华的pip源,它5分钟同步一次. 临时使用: pip 后加参数 -i h ...
- org.elasticsearch.search.sort.SortBuilder使用
org.elasticsearch.search.sort.SortBuilder是一个抽象类,有4个子类 org.elasticsearch.search.sort.FieldSortBuilder ...
- Robot Framework(Collections 库)
Collections 库 Collections 库同样为Robot Framework 标准类库,它所提供的关键字主要用于列表.索引.字典的处理. 在使用之前需要在测试套件(项目)中添加:
- 微服务~Consul服务注册与发现
服务发现是基于微服务架构的关键原则之一.尝试配置每个客户端或某种形式的约定可能非常困难,可以非常脆弱.Consul通过HTTP API和DNS提供服务发现服务.Spring Cloud Consul利 ...
- ruby中的\z与\Z区别
s = "this is\nthe name\n" puts "--------------" puts s.match(/name\Z/) puts s.ma ...
- 关于new Option()
先来了解下,如何运用js实现select动态添加option. //1.动态创建select function createSelect(){ var mySelect = document.crea ...
- vmstat命令——监控给定时间间隔的服务器的状态值
vmstat n m 时间间隔为n秒,采集m组数据vmstat n 时间间隔为n秒 # vmstat 2 3 procs -----------memory---------- ---swap ...
- Unity3d编辑器扩展学习笔记
编辑器扩展 1.添加菜单栏:把特性应用于静态方法 参数1:菜单名的空格后面是定义快捷键(单符号得用"_"开头,组合键%=Ctrl,#=Shift,&=Alt) 参数2:通过 ...
- NPOI excel导出快速构建
直接上代码,这个是一个在webFrom中的例子,要请求的页面是ashx public void ExportVisaFeeAll(HttpContext context) { try { string ...