amp安装 linux
2012-03-06 14:40:08 weixin_34034670 阅读数 1

apache:

如果采用RPM包安装,安装路径应在 /etc/httpd目录下

apache配置文件:/etc/httpd/conf/httpd.conf

Apache模块路径:/usr/sbin/apachectl

web目录:/var/www/html

如果采用源代码安装,一般默认安装在/usr/local/apache2目录下

php:

如果采用RPM包安装,安装路径应在 /etc/目录下

php的配置文件:/etc/php.ini

如果采用源代码安装,一般默认安装在/usr/local/lib目录下

php配置文件: /usr/local/lib/php.ini

或/usr/local/php/etc/php.ini

mysql:

如果采用RPM包安装,安装路径应在/usr/share/mysql目录下

mysqldump文件位置:/usr/bin/mysqldump

mysqli配置文件:

/etc/my.cnf或/usr/share/mysql/my.cnf

mysql数据目录在/var/lib/mysql目录下

如果采用源代码安装,一般默认安装在/usr/local/mysql目录下

转载于:https://blog.51cto.com/wanwentao/798140

2011-04-12 17:34:41 arganzheng 阅读数 33

Install AMP from source under Linux(Ubuntu)

2011-02-05 星期六 晴朗

Install AMP from source under Linux(Ubuntu)

安装Apache2.2.17

Follow the instruction in the offical website, it should work:
Overview for the impatient

Download $ lynx http://httpd.apache.org/download.cgi Extract $ gzip -d httpd-2_0_NN.tar.gz 
$ tar xvf httpd-2_0_NN.tar Configure $ ./configure --prefix=PREFIX Compile $ make Install $ make install Customize $ vi PREFIX/conf/httpd.conf Test $ PREFIX/bin/apachectl start

说明:上面的./configure只指定了安装目录,这种编译方式是静态编译方式,并且只包含最核型的模块,如下:

forrest@forrest-laptop:~/Install/apache2/modules$ ls
httpd.exp  libphp5.so

说明:libphp5.so是我后来编译php才进入的。可以用httpd -l选项查看静态编译进入的模块(注意查看不到动态加载的模块的,如mod_php5.so)

forrest@forrest-laptop:~/Install/apache2$ bin/httpd -l
Compiled in modules:
  core.c
  mod_authn_file.c
  mod_authn_default.c
  mod_authz_host.c
  mod_authz_groupfile.c
  mod_authz_user.c
  mod_authz_default.c
  mod_auth_basic.c
  mod_include.c
  mod_filter.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  mod_version.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_cgi.c
  mod_negotiation.c
  mod_dir.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c

这样的编译方式往往只能满足最小化的需求,对于一个比较大型的网站,往往需要更多的module,比如mod_rewrite,比如mod_ssl,比如mod_jk,etc. 主要有两种解决方案:
第一种方式是重新安装,这就是静态编译模块的坏处,一旦需要新增或者修改删除模块,需要重新编译整个apache。所以建议下次如果是重新编译的话,务必改成动态链接。如果要支持ssl,那么需要在编译的时候增加编译选项:--enable-ssl=shared。第二种方式是,编译成动态链接库(so),配置httpd.conf,让apache启动时加载(LoadModules)。
官方文档写的很详细,也很精彩:http://httpd.apache.org/docs/2.0/dso.html

使用如下编译方式,也不会生成很多modules:

forrest@forrest-laptop:~/Sources/httpd-2.2.17$ ./configure --prefix=/home/forrest/Install/apache2_dynamic --enable-modules=all --enable-so 
forrest@forrest-laptop:~/Install/apache2_dynamic/modules$ ls
httpd.exp

加上 --enable-mods-shared=all之后,就有很多modules了:

forrest@forrest-laptop:~/Sources/httpd-2.2.17$ ./configure --prefix=/home/forrest/Install/apache2_dynamic3 --enable-modules=all --enable-so --enable-mods-shared=all

forrest@forrest-laptop:~/Install/apache2_dynamic3/modules$ ls
httpd.exp           mod_authn_default.so    mod_cern_meta.so  mod_expires.so     mod_log_forensic.so  mod_status.so
mod_actions.so      mod_authn_file.so       mod_cgi.so        mod_ext_filter.so  mod_logio.so         mod_substitute.so
mod_alias.so        mod_authz_dbm.so        mod_dav_fs.so     mod_filter.so      mod_mime_magic.so    mod_unique_id.so
mod_asis.so         mod_authz_default.so    mod_dav.so        mod_headers.so     mod_mime.so          mod_userdir.so
mod_auth_basic.so   mod_authz_groupfile.so  mod_dbd.so        mod_ident.so       mod_negotiation.so   mod_usertrack.so
mod_auth_digest.so  mod_authz_host.so       mod_deflate.so    mod_imagemap.so    mod_reqtimeout.so    mod_version.so
mod_authn_anon.so   mod_authz_owner.so      mod_dir.so        mod_include.so     mod_rewrite.so       mod_vhost_alias.so
mod_authn_dbd.so    mod_authz_user.so       mod_dumpio.so     mod_info.so        mod_setenvif.so
mod_authn_dbm.so    mod_autoindex.so        mod_env.so        mod_log_config.so  mod_speling.so

forrest@forrest-laptop:~/Install/apache2_dynamic3/modules$ ls | wc -l
52

即使设置为all,仍然是有些模块有,有些模块没有:

forrest@forrest-laptop:~/Install/apache2_dynamic3/modules$ ls | grep ssl
forrest@forrest-laptop:~/Install/apache2_dynamic3/modules$ ls | grep rewrite
mod_rewrite.so

对于ssl模块,需要在编译的时候再加上--enable-ssl编译选项。但是需要注意的是ssl需要openssl的头文件,所以需要先安装openssl。

改成most,变成47个。

forrest@forrest-laptop:~/Sources/httpd-2.2.17$ ./configure --prefix=/home/forrest/Install/apache2_dynamic --enable-modules=all --enable-so --enable-mods-shared=most
forrest@forrest-laptop:~/Install/apache2_dynamic/modules$ ls
httpd.exp           mod_authn_dbm.so        mod_authz_user.so  mod_dumpio.so      mod_include.so      mod_setenvif.so
mod_actions.so      mod_authn_default.so    mod_autoindex.so   mod_env.so         mod_info.so         mod_speling.so
mod_alias.so        mod_authn_file.so       mod_cgi.so         mod_expires.so     mod_log_config.so   mod_status.so
mod_asis.so         mod_authz_dbm.so        mod_dav_fs.so      mod_ext_filter.so  mod_logio.so        mod_substitute.so
mod_auth_basic.so   mod_authz_default.so    mod_dav.so         mod_filter.so      mod_mime.so         mod_userdir.so
mod_auth_digest.so  mod_authz_groupfile.so  mod_dbd.so         mod_headers.so     mod_negotiation.so  mod_version.so
mod_authn_anon.so   mod_authz_host.so       mod_deflate.so     mod_ident.so       mod_reqtimeout.so   mod_vhost_alias.so
mod_authn_dbd.so    mod_authz_owner.so      mod_dir.so         mod_imagemap.so    mod_rewrite.so
forrest@forrest-laptop:~/Install/apache2_dynamic/modules$ ls | wc -l
47

发现其实其关键作用的只是这个编译选项: --enable-mods-shared=most

forrest@forrest-laptop:~/Sources/httpd-2.2.17$ ./configure --prefix=/home/forrest/Install/apache2_dynamic --enable-mods-shared=most
forrest@forrest-laptop:~/Install/apache2_dynamic/modules$ ls | wc -l
47

安装mod_ssl,这个module在apache的源码中,只需要增加--enable-ssl编译选项,就可以了。不像mod_jk和mod_php,需要另外下载代码,用apxs安装。
不过需要注意的是ssl需要openssl的头文件,所以需要先安装openssl。

checking whether to enable mod_ssl... checking dependencies
checking for SSL/TLS toolkit base... none
checking for OpenSSL version... checking openssl/opensslv.h usability... no
checking openssl/opensslv.h presence... no
checking for openssl/opensslv.h... no
checking openssl/ssl.h usability... no
checking openssl/ssl.h presence... no
checking for openssl/ssl.h... no
no OpenSSL headers found
checking for SSL-C version... checking sslc.h usability... no
checking sslc.h presence... no
checking for sslc.h... no
no SSL-C headers found
configure: error: ...No recognized SSL/TLS toolkit detected

forrest@forrest-laptop:~/Sources/httpd-2.2.17$ sudo apt-get install openssl libssl-dev

forrest@forrest-laptop:~/Sources/httpd-2.2.17$ ./configure --prefix=/home/forrest/Install/apache2_dynamic --enable-mods-shared=most --enable-ssl 
forrest@forrest-laptop:~/Install/apache2_dynamic/modules$ ls
httpd.exp           mod_authn_dbm.so        mod_authz_user.so  mod_dumpio.so      mod_include.so      mod_setenvif.so
mod_actions.so      mod_authn_default.so    mod_autoindex.so   mod_env.so         mod_info.so         mod_speling.so
mod_alias.so        mod_authn_file.so       mod_cgi.so         mod_expires.so     mod_log_config.so   mod_ssl.so
mod_asis.so         mod_authz_dbm.so        mod_dav_fs.so      mod_ext_filter.so  mod_logio.so        mod_status.so
mod_auth_basic.so   mod_authz_default.so    mod_dav.so         mod_filter.so      mod_mime.so         mod_substitute.so
mod_auth_digest.so  mod_authz_groupfile.so  mod_dbd.so         mod_headers.so     mod_negotiation.so  mod_userdir.so
mod_authn_anon.so   mod_authz_host.so       mod_deflate.so     mod_ident.so       mod_reqtimeout.so   mod_version.so
mod_authn_dbd.so    mod_authz_owner.so      mod_dir.so         mod_imagemap.so    mod_rewrite.so      mod_vhost_alias.so
forrest@forrest-laptop:~/Install/apache2_dynamic/modules$ ls |wc -l
48

2. 安装MySQL5.1.7

参考文档:http://dev.mysql.com/doc/refman/5.1/en/installing-source-distribution.html

# Preconfiguration setup
shell> groupadd mysql
shell> useradd -g mysql mysql
# Beginning of source-build specific instructions
shell> tar zxvf mysql-VERSION.tar.gz
shell> cd mysql-VERSION
shell> ./configure --prefix=/home/forrest/Install/mysql
shell> make
shell> make install
# End of source-build specific instructions
# Postinstallation setup
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql --with-datadir=/home/forrest/Install/mysql/data
shell> chown -R root .
shell> chown -R mysql var
# Next command is optional
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> add basedir and datadir to [mysqld]
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server
forrest@forrest-laptop:~/Install/mysql$ bin/mysql_install_db --user=mysql --basedir=/home/forrest/Install/mysql --datadir=/home/forrest/Install/mysql/data
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/home/forrest/Install/mysql/bin/mysqladmin -u root password 'new-password'
/home/forrest/Install/mysql/bin/mysqladmin -u root -h forrest-laptop password 'new-password'

Alternatively you can run:
/home/forrest/Install/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /home/forrest/Install/mysql ; /home/forrest/Install/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /home/forrest/Install/mysql/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /home/forrest/Install/mysql/scripts/mysqlbug script!

forrest@forrest-laptop:~/Install/mysql$ 

set the root password:
/home/forrest/Install/mysql/bin/mysqladmin -u root password 'new-password'
update the root password:
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

3. PHP5.2.7

forrest@forrest-laptop:~/Sources/php-5.2.17$ ./configure --with-apxs2=/home/forrest/Install/apache2/bin/apxs --with-mysql=/home/forrest/Install/mysql/
forrest@forrest-laptop:~/Sources/php-5.2.17$ make
forrest@forrest-laptop:~/Sources/php-5.2.17$ sudo make install
[sudo] password for forrest: 
Installing PHP SAPI module:       apache2handler
/home/forrest/Install/apache2/build/instdso.sh SH_LIBTOOL='/home/forrest/Install/apache2/build/libtool' libphp5.la /home/forrest/Install/apache2/modules
/home/forrest/Install/apache2/build/libtool --mode=install cp libphp5.la /home/forrest/Install/apache2/modules/
cp .libs/libphp5.so /home/forrest/Install/apache2/modules/libphp5.so
cp .libs/libphp5.lai /home/forrest/Install/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /home/forrest/Sources/php-5.2.17/libs'
chmod 755 /home/forrest/Install/apache2/modules/libphp5.so
[activating module `php5' in /home/forrest/Install/apache2/conf/httpd.conf]
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/man/man1/
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Archive_Tar    - installed: 1.3.7
[PEAR] Console_Getopt - installed: 1.2.3
[PEAR] Structures_Graph- installed: 1.0.3
[PEAR] XML_Util       - installed: 1.2.1
[PEAR] PEAR           - installed: 1.9.1
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
Installing PDO headers:          /usr/local/include/php/ext/pdo/
forrest@forrest-laptop:~/Sources/php-5.2.17$
Enabling the mysqli Extension on Linux/Unix
Enabling the mysqli extension on the Linux/Unix platform is accomplished by configuring PHP using the --with-mysqli flag. This flag should point to the location of the mysql_config program available to MySQL 4.1 and greater.

关于PHP的配置文件——php.ini
与MySQL一样,PHP也有自己的配置文件,叫做php.ini,与MySQL一样,这个配置文件需要用户自己cp到某个特定的目录(配置目录,编译选项--with-config-file-path 指定)。
如果没有指定,默认是/usr/local/lib/目录下。可以使用phpinfo()查看:

 

Configuration File (php.ini) Path /usr/local/lib
Configuration File (php.ini) Path /usr/local/lib

 

PHP comes bundled with a configuration file that controls many aspects of PHP's behavior. This file is known as php.ini, but it was originally named php.ini-dist. You need to copy this file to its appropriate location and rename it php.ini. The later section "Configuring PHP" examines php.ini's purpose and contents in detail. Note that you can place this configuration file anywhere you please, but if you choose a nondefault location, you also need to configure PHP using the --with-config-file-path option. Also note that there is another
default configuration file at your disposal, php.ini-recommended. This file sets various nonstandard settings and is intended to better secure and optimize your installation, although this configuration may not be fully compatible with some of the legacy applications. Consider using this file in lieu of php.ini-dist. To use this file, execute the following command:
%>cp php.ini-recommended /usr/local/lib/php.ini

在Unix上,php.ini文件缺省放在/usr/local/lib上面,因为缺省的存放路径是<install-path> /lib,但是可以在编译的时候使用--wthi-config-file-path参数来修改php.ini的存放位置,例如你可以使用--with-config-file-path=/etc把它存放到/etc下面,然后可以从源码包中拷贝php.ini-dist到/etc/php.ini并修改使之满足需要。

4. phpMyAdmin

http://www.phpmyadmin.net/documentation/

5. Testing Your Installation

The best way to verify your PHP installation is by attempting to execute a PHP script. Open a text editor and add the following lines to a new file:

<?php
phpinfo();
?>

Save this file as phpinfo.php. If you're running Apache, save it to the htdocs directory. If you're
running IIS, save the file to C:\inetpub\wwwroot.


关于PEAR:

PEAR (the acronym for PHP Extension and Application Repository) is one of the most effective means for finding and reusing great PHP code. Inspired by Perl's wildly popular CPAN (Comprehensive Perl Archive Network), the PEAR project was started in 1999 by noted PHP developer Stig Bakken, with the first stable release bundled with PHP version 4.3.0.

可以使用pear管理(安装卸载、升降级)packages。然后应用程序只需要将需要使用的packages Including进来。
Including a Package within Your Scripts

Using an installed PEAR package is simple. All you need to do is make the package contents available to
your script with include or preferably require. Keep in mind that you need to add the PEAR base
directory to your include_path directive; otherwise, an error similar to the following will occur:
Fatal error: Class 'MDB2' not found in /home/www/htdocs/book/11/database.php
on line 3
Those of you with particularly keen eyes might have noticed that in the earlier example involving
the Numbers_Roman package, a directory was also referenced:
require_once("Numbers/Roman.php");

像mysql和gd这样的库没有在PEAR中,只能重新编译PHP模块。

2019-01-21 11:32:07 u014082689 阅读数 442
  • Linux + FreeRTOS

1.创建FreeRTOS工程

  • 使用ps7_cortexa9_1创建FreeRTOS工程,示例如下

  • 修改main.c 去掉xil_printf相关的调用,根据FPGA工程师提供的寄存器地址和bit文件操作LED周期闪烁
  • 修改lscript.ld文件地址(不要和cpu0使用地址冲突)

  • 打开board support package setting界面,添加 -DUSE_AMP=1 宏

  • 打开board support package setting界面,去除stdin及stdout配置为none

  • 修改FreeRTOS  bsp工程中中的boot.s文件,注释地址映射部分(Vivado 2016无需此步骤)。如下图所示:

  • 编译生成FreeRTOS可执行文件

2.修改Linux相关文件

  • U-boot、Linux设备树修改
memory {

device_type = "memory";

reg = <0x0 0x30000000>;

};/*修改CPU0地址空间范围*/
  • Linux内核启动参数,修改设置为SMP,CPU个数为1

            bootargs "console=ttyPS0,115200 maxcpus=1 root=/dev/ram rw earlyprintk "

  • 编译u-boot、内核

3.创建fsbl工程

  • 在ps7_cortexa9_0上创建普通fsbl工程
  • 在main.c中,main函数前添加如下函数定义
#define sev() __asm__("sev")

#define CPU1STARTADR 0xfffffff0

void LoadCpu1(void)

{

#if 1



    *(volatile unsigned int *)0x2F000000 = 0x12345678;

    *(volatile unsigned int *)0x2F000010 = 0x87654321;

    *(volatile unsigned int *)0x3F000000 = 0x19890314;

    *(volatile unsigned int *)0x3F000010 = 0x20170427;

    fsbl_printf(DEBUG_GENERAL,"FSBL: DDR Test:%x,%x,%x,%x\n\r",*(volatile unsigned int *)0x2F000000,*(volatile unsigned int *)0x2F000010,*(volatile unsigned int *)0x3F000000,*(volatile unsigned int *)0x3F000010);



    fsbl_printf(DEBUG_GENERAL,"FSBL: writing startaddress for cpu1\n\r");

    Xil_Out32(CPU1STARTADR, 0x30000000);

    dmb(); //waits until write has finished



    fsbl_printf(DEBUG_GENERAL,"FSBL: sending the SEV to wake up CPU1\n\r");

    sev();



#endif

}
  • 在main函数中,如下位置添加函数调用

 

  /*

     * Load boot image

     */

    HandoffAddress = LoadBootImage();



    fsbl_printf(DEBUG_INFO,"Handoff Address: 0x%08lx\r\n",HandoffAddress);

    LoadCpu1();
  • 编译生成fsbl.elf
  • 创建BOOT.bin运行
    • 利用SDK创建BOOT.bin文件,文件顺序为fsbl.elf、zynq.bit(FPGA工程师提供)、u-boot.elf以及freeRtos.elf。
    • 将生成的BOOT.bin放进SD卡,启动模式修改为SD启动。

       上电后可以观察到:

             CPU0 终端串口上 Linux启动正常

             CPU1 测试LED一直在闪烁

2019-06-04 20:34:46 luo_xian_neng 阅读数 8
2019-01-21 10:38:35 u014082689 阅读数 303

Linux + RT-Thread

1.U-boot、Linux设备树修改

memory {

device_type = "memory";

reg = <0x0 0x30000000>;

};/*修改CPU0地址空间范围*/

2.Linux内核启动参数,修改设置为SMP,CPU个数为1

  bootargs "console=ttyPS0,115200 maxcpus=1 root=/dev/ram rw earlyprintk "

 

3.编译u-boot、内核

4.修改RT-thread相关文件

  • github下载RT-thread最新的4.0.0内核源码
  • github下载RT-thread  env工具
  • 修改bsp/zynq7000/ drivers /uart.c
//INIT_BOARD_EXPORT(rt_hw_uart_init);
  • 修改bsp/zynq7000/drivers/board.h
#define HEAP_END        (void*)(0x40000000)
  • 修改bsp/zynq7000/drivers/board.c
void rt_hw_board_init()

{

    rt_components_board_init();

   // rt_console_set_device(RT_CONSOLE_DEVICE_NAME);

}
  • 修改bsp/zynq7000/applications/application.c
添加线程代码,周期控制测试Led闪烁:

static void rt_led_thread_entry(void *parameter)

{

    /* do component initialization */

    unsigned char uc = 1;

    while(1)

    {

              *( (unsigned int *) 0x43c00000 ) = uc;

        

                          uc = ~uc;

                          rt_thread_delay(1000);

    }

                         

    /* add your initialization here */

}

int rt_application_init()

{

    rt_thread_t tid;

    tid = rt_thread_create("init", rt_init_thread_entry, RT_NULL, 2048,

                            RT_THREAD_PRIORITY_MAX/3, 20);
    if (tid != RT_NULL)

        rt_thread_startup(tid);

   tid = rt_thread_create("led", rt_led_thread_entry, RT_NULL, 2048,

                            RT_THREAD_PRIORITY_MAX/3, 20);
    if (tid != RT_NULL)

        rt_thread_startup(tid);

    return 0;

}
  • 修改bsp/zynq7000/rtconfig.h 注释有关shell、msh、finish、serial以及console相关的宏定义
  • 修改bsp/zynq7000/zynq7000.ld  链接地址修改为. = 0x30000000;
  • 修改libcpu/arm/zynq7000/mmu.c
/* set page table */

    /* no access to the memory below .text */

    /* 128M cached DDR memory */

    rt_hw_mmu_setmtt((rt_uint32_t)&__text_start, 0x40000000-1,

                     0x30000000, RW_CB);

 

  • 编译RT-thread
  • 运行env工具,cd  bsp/zynq7000
  • scons 编译生成rtthread-zynq7000.elf文件
  • 创建BOOT.bin运行
  • 利用SDK创建BOOT.bin文件,文件顺序为fsbl.elf、zynq.bit(FPGA工程师提供)、u-boot.elf以及rtthread-zynq7000.elf。
    • 将生成的BOOT.bin放进SD卡,启动模式修改为Sd启动。
    • 上电后可以观察到:

        CPU0 终端串口上 Linux启动正常

         CPU1 测试LED一直在闪烁

Linux的安装

阅读数 74

Linux的安装

阅读数 6

Linux——安装

阅读数 24

没有更多推荐了,返回首页