autostart on fastboot是什么意思思

下次自动登录
现在的位置:
& 综合 & 正文
Install Nginx/PHP-FPM on Fedora 20/19, CentOS/RHEL 6.5/5.10
Install Nginx/PHP-FPM on Fedora 20/19, CentOS/RHEL 6.5/5.10
Do you like this?
I have once written guide, but this guide is “updated” version,howto install Nginx with PHP 5.5.6 and PHP-FPM on Fedora 20/19/18/17, CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10 and Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10.
PHP-FPM is easier to use and configure than FastCGI and some tests says that PHP-FPM is even much more efficient than FastCGI.
is a robust, small and high performance http server, reverse proxy server and also mail proxy server.
is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially
busier sites.
Install Nginx, PHP 5.5.6 and PHP-FPM on Fedora 20/19/18/17, CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10, Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10
1. Change to root user.
2. Install needed repositories
Fedora 20/19/18/17 Remi repository
## Remi Dependency on Fedora 19/18/17
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
## Fedora 20 ##
rpm -Uvh /remi-release-20.rpm
## Fedora 19 ##
rpm -Uvh /remi-release-19.rpm
## Fedora 18 ##
rpm -Uvh /remi-release-18.rpm
## Fedora 17 ##
rpm -Uvh /remi-release-17.rpm
CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10 and Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10 Remi repository
## Remi Dependency on CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
## CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh /enterprise/remi-release-6.rpm
## Remi Dependency on CentOS 5 and Red Hat (RHEL) 5 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
## CentOS 5 and Red Hat (RHEL) 5 ##
rpm -Uvh /enterprise/remi-release-5.rpm
CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10 and Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10 Nginx repository
Create file /etc/yum.repos.d/nginx.repo and add following content to repo file:CentOS
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
Red Hat (RHEL)
name=nginx repo
baseurl=http://nginx.org/packages/rhel/$releasever/$basearch/
gpgcheck=0
3. Install Nginx, PHP 5.5.6 and PHP-FPM
Fedora 20/19
yum --enablerepo=remi install nginx php-fpm php-common
Fedora 18/17
yum --enablerepo=remi,remi-test install nginx php-fpm php-common
CentOS 6.5/5.10 and Red Hat (RHEL) 6.5/5.10
yum --enablerepo=remi,remi-php55 install nginx php-fpm php-common
4. Install PHP 5.5.6 modules
APC (php-pecl-apc) - APC caches and optimizes PHP intermediate code
CLI (php-cli) - Command-line interface for PHP
PEAR (php-pear) - PHP Extension and Application Repository framework
PDO (php-pdo) - A database access abstraction module for PHP applications
MySQL (php-mysqlnd) - A module for PHP applications that use MySQL databases
PostgreSQL (php-pgsql) - A PostgreSQL database module for PHP
MongoDB (php-pecl-mongo) - PHP MongoDB database driver
SQLite (php-sqlite) - Extension for the SQLite V2 Embeddable SQL Database Engine
Memcache (php-pecl-memcache) - Extension to work with the Memcached caching daemon
Memcached (php-pecl-memcached) - Extension to work with the Memcached caching daemon
GD (php-gd) - A module for PHP applications for using the gd graphics library
XML (php-xml) - A module for PHP applications which use XML
MBString (php-mbstring) - A module for PHP applications which need multi-byte string handling
MCrypt (php-mcrypt) - Standard PHP module provides mcrypt library support
Select what you need: APC, CLI, PEAR, PDO, MySQL, PostgreSQL, MongoDB, SQLite, Memcache, Memcached, GD, MBString, MCrypt, XML
More info about PHP APC from
Fedora 20/19
yum --enablerepo=remi install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
Fedora 18/17
yum --enablerepo=remi,remi-test install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
CentOS 6.5/5.10 and Red Hat (RHEL) 6.5/5.10
yum --enablerepo=remi,remi-php55 install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
5. Stop httpd (Apache) server, Start Nginx HTTP server and PHP-FPM (FastCGI Process Manager)
Stop httpd (Apache)
/etc/init.d/httpd stop
service httpd stop
Start Nginx
/etc/init.d/nginx start ## use restart after update
service nginx start ## use restart after update
Start PHP-FPM
/etc/init.d/php-fpm start ## use restart after update
service php-fpm start ## use restart after update
6. Autostart Nginx and PHP-FPM on boot, also prevent httpd (Apache) autostarting on boot
Prevent httpd (Apache) autostarting on boot
chkconfig httpd off
Autostart Nginx on boot
systemctl enable nginx.service
CentOS / Red Hat (RHEL)
chkconfig --add nginx
chkconfig --levels 235 nginx on
Autostart PHP-FPM on boot
systemctl enable php-fpm.service
CentOS / Red Hat (RHEL)
chkconfig --add php-fpm
chkconfig --levels 235 php-fpm on
7. Configure Nginx and PHP-FPM
Create directory layout for your site
I use here testsite.local site, but this could of course be your real site, likewww.if-not-true-.
## public_html directory and logs directory ##
mkdir -p /srv/www/testsite.local/public_html
mkdir /srv/www/testsite.local/logs
chown -R apache:apache /srv/www/testsite.local
Alternative setup to add logs under /var/log directory.
## public_html directory and logs directory ##
mkdir -p /srv/www/testsite.local/public_html
mkdir -p /var/log/nginx/testsite.local
chown -R apache:apache /srv/www/testsite.local
chown -R nginx:nginx /var/log/nginx
Note: I use apache user and group here, because PHP-FPM runs as apache default (apache choosed to be able to access some dir as httpd). If you use some other user on your php-fpm conf then change this accordingly.
Create and configure virtual host directories under /etc/nginx
mkdir /etc/nginx/sites-available
mkdir /etc/nginx/sites-enabled
Add following lines to /etc/nginx/nginx.conf file, after “include /etc/nginx/conf.d/*.conf” line (inside http block).
## Load virtual host conf files. ##
include /etc/nginx/sites-enabled/*;
Create testsite.local virtual host file
Add following content to /etc/nginx/sites-available/testsite.local file. This is very basic virtual host config.
server_name testsite.
access_log /srv/www/testsite.local/logs/access.
error_log /srv/www/testsite.local/logs/error.
root /srv/www/testsite.local/public_
location / {
index index.html index.htm index.
location ~ \.php$ {
include /etc/nginx/fastcgi_
fastcgi_pass
127.0.0.1:9000;
fastcgi_index index.
fastcgi_param SCRIPT_FILENAME /srv/www/testsite.local/public_html$fastcgi_script_
Link your virtual host to /etc/nginx/sites-enabled
cd /etc/nginx/sites-enabled/
ln -s /etc/nginx/sites-available/testsite.local
service nginx restart
Add your testsite.local “domain” to /etc/hosts file
/etc/hosts file Nginx on same machine
127.0.0.1 … row should look like example following:
localhost.localdomain localhost testsite.local
And if you use another machine where you are running your Nginx server, then add it’s public IP as following:
Note: This is just very simple basic configuration, but if you want configure and optimize Nginx and PHP-FPM more then check following guide,
8. Test your Nginx and PHP-FPM setup
Create /srv/www/testsite.local/public_html/index.php file with following content:
phpinfo();
Access following address, with your browser.
If you get 403 forbidden error, then you probably have problem with SELinux, then run simply following command:
chcon -R -t httpd_sys_content_t /srv/www/testsite.local/public_html
## Or some apps might need httpd_sys_rw_content_t ##
chcon -R -t httpd_sys_rw_content_t /srv/www/testsite.local/public_html
Enable Remote Connection to Nginx Web Server (Open Port 80 on Iptables Firewall)
1. CentOS/Red Hat (RHEL)
1.1 Edit /etc/sysconfig/iptables file:
nano -w /etc/sysconfig/iptables
1.2 Add following INPUT rule:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
1.3 Restart Iptables Firewall:
service iptables restart
/etc/init.d/iptables restart
2.1 Add New Rule to Firewalld
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add --port=80/tcp
2.2 Restart Iptables
systemctl restart iptables.service
3. Test remote connection
Access following address, with your browser.
&&&&推荐文章:
【上篇】【下篇】下载:大于5千次***
推荐下载方式:
(通过乐助手直接***应用到手机)
其他下载方式:
如何使用二维码?
1.下载***
2.打开二维码扫描软件
3.用摄像头对准二维码扫描
扫描二维码即可下载
Select ONE application that you want to auto start (autorun) after Android OS boot-up. AutoStart works on all devices and doesnt require root.You can only choose ONE app to auto launch at boot.... 展开Android / Cannot start app at boot on certain devices (e.g. Xiaomi) - Stack Overflow
to customize your list.
Join the Stack Overflow Community
Stack Overflow is a community of 6.5 million programmers, just like you, helping each other.
J it only takes a minute:
I followed all the guidance found on SO to autostart app at boot time.
In my manifest, I have set the right permission (RECEIVE_BOOT_COMPLETED) and also declared my broadcast receiver: .BootReceiver picking up Android.Intent.Action.BOOT_COMPLETED.
I also launch my service in BootReceiver, this is very straightforward stuff.
The thing is, my app starts at boot time on certain devices (I hope most devices) but not on some of them. I have a Xiaomi phone that gives me the following error at boot time:
"Unable to launch app com..example/10120 for broadcast Intent {act=android.intent.action.BOOT_COMPLETE flg=0x8000010 (has extras) }: process is not permitted to autostart."
I am surprised to see this message, because I can see that the list of permissions includes running at startup.
There must be a way, because Whatsapp for instance is launched at boot time.
Any clue would be highly appreciated.
Same here. I tried to delete the file in the SD card ( but the system direct to internal storage ) by using the permission WRITE_EXTERNAL_STORAGE, and get the similar message from log-cat. Maybe it can be fixed by rooting the xiao-mi mobile, that's what I searched from the Internet.
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled

参考资料

 

随机推荐