本篇文章给大家带来的内容是关于如何使用LAMP+WordPress的一键安装脚本,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。
#!/bin/bash # Description: This is a one-click script to compile the installation LAMP (PHP in FastCGI working mode) # Environment: centos7.5, apr-1.6.3.tar.gz, apr-util-1.6.1.tar.gz, httpd-2.4.34.tar.bz2, php-7.1.18.tar.bz2, mariadb-10.2.16-linux-x86_64.tar.gz, wordpress-4.9.4-zh_CN .tar.gz # Download the above packages and place them in the /app/ # Ensure that yum warehouses are set up, including local CDS and epel # All the services after compilation and installation are placed in /app/lamp/ echo -e '\033[1;5;31mBEGIN \033[0m' mkdir -p /app/lamp # Install the required development kit groups echo -e '\033[1;31mInstall the group tools \033[0m' yum groupinstall -y 'development tools' echo -e '\033[1;31mFinish Installing the group tools \033[0m' # Create the function to compile and install HTTPD httpd () { # Unzip and move folders cd /app tar xf apr-1.6.3.tar.gz tar xf apr-util-1.6.1.tar.gz tar xf httpd-2.4.34.tar.bz2 mv apr-1.6.3 httpd-2.4.34/srclib/apr mv apr-util-1.6.1 httpd-2.4.34/srclib/apr-util # Create the user and install the packages required for compilation useradd -r -s /sbin/nologin apache yum install -y pcre-devel openssl-devel expat-devel # Start compiling and installing cd httpd-2.4.34/ ./configure --prefix=/app/lamp/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --enable-modules=most --enable-mpms-share d=all --with-mpm=prefork --with-included-apr make && make install # Modify configuration file cd /app/lamp/httpd24/conf sed -i '/^User/s/daemon/apache/' httpd.conf sed -i '/^Group/s/daemon/apache/' httpd.conf sed -i 's@^#Load.∗proxy.soLoad.∗proxy.so$@\1@' httpd.conf sed -i 's@^#Load.∗fcgi.soLoad.∗fcgi.so$@\1@' httpd.conf sed -i 's@[]\+D.∗[]\+D.∗@\1index.php @' httpd.conf echo "Include conf/extra/httpd-php.conf" >> httpd.conf cd extra/ cat > httpd-php.conf <<-EOF AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps ProxyRequests Off ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/app/lamp/httpd24/htdocs/$1 EOF cd } # Create the function to install mysql with binary package mariadb () { # Create the user useradd -r -s /sbin/nologin mysql # Unzip the file and create a soft connection and modify permissions cd /app tar xf mariadb-10.2.16-linux-x86_64.tar.gz -C /usr/local/ cd /usr/local/ ln -s mariadb-10.2.16-linux-x86_64/ mysql chown -R mysql.mysql mysql/ # Initialize the database and revise the configuration file mkdir /app/lamp/mysql chown -R mysql.mysql /app/lamp/mysql cd /usr/local/mysql/ scripts/mysql_install_db --datadir=/app/lamp/mysql --user=mysql mkdir /etc/mysql/ cp support-files/my-huge.cnf /etc/mysql/my.cnf sed -i '/^\[mysqld]/adatadir=/app/lamp/mysql' /etc/mysql/my.cnf # Preparation for startup script cp support-files/mysql.server /etc/init.d/mysqld cd } # Create the function to compile and install PHP php () { # Install the packages required for compilation yum install -y libxml2-devel bzip2-devel libmcrypt-devel # Unzip and start compiling and installing cd /app tar xf php-7.1.18.tar.bz2 &> /dev/null cd php-7.1.18/ ./configure --prefix=/app/lamp/php --enable-mysqlnd --with-mysqli=mysqlnd --with-openssl --with-pdo-mysql=mysqlnd --enable-mbstring --with-freetype-dir --with- jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --enable-fpm --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php .d --enable-maintainer-zts --disable-fileinfo make && make install # Modify some necessary files cp php.ini-production /etc/php.ini cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm chmod +x /etc/init.d/php-fpm cd /app/lamp/php/etc cp php-fpm.conf.default php-fpm.conf cp php-fpm.d/www.conf.default php-fpm.d/www.conf cd } Main () { echo -e '\033[1;31mStart installing httpd \033[0m' httpd echo -e '\033[1;31mHTTPD is finished \033[0m' echo -e '\033[1;31mStart installing MariaDB \033[0m' mariadb echo -e '\033[1;31mMariaDB is finished \033[0m' echo -e '\033[1;31mStart installing PHP \033[0m' php echo -e '\033[1;31mPHP is finished \033[0m' } Main # Add the binary to the path variable echo 'PATH=/app/lamp/php/bin:/app/lamp/httpd24/bin:/usr/local/mysql/bin:$PATH' > /etc/profile.d/lamp.sh source /etc/profile.d/lamp.sh # Start the service apachectl service mysqld start service php-fpm start echo -e '\033[1;31mAll services are running \033[0m' # Building a blog site echo -e '\033[1;31mStart building the blog site \033[0m' mysql -e "create database wpdb;grant all on wpdb.* to wpuser@'localhost' identified by 'centos'" cd /app tar xf wordpress-4.9.4-zh_CN.tar.gz cp -r wordpress/* /app/lamp/httpd24/htdocs/ cd /app/lamp/httpd24/htdocs/ mv wp-config-sample.php wp-config.php sed -i '/DB_NAME/s/database_name_here/wpdb/' wp-config.php sed -i '/DB_USER/s/username_here/wpuser/' wp-config.php sed -i '/DB_PASSWORD/s/password_here/centos/' wp-config.php echo -e '\033[1;31mBlog is set up \033[0m' echo -e '\033[1;5;31mEND \033[0m' # END
以上がLAMP+WordPressのワンクリックインストールスクリプトの使い方の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

メンテナンスモードは、システムのメンテナンスと修理に使用され、管理者が簡素化された環境で作業できるようにします。 1。システム修理:破損したファイルシステムとブートローダーを修理します。 2。パスワードリセット:ルートユーザーパスワードをリセットします。 3。パッケージ管理:ソフトウェアパッケージをインストール、更新、または削除します。 GRUB構成を変更するか、特定のキーを使用してメンテナンスモードを入力することにより、メンテナンスタスクを実行した後、安全に終了できます。

Linuxネットワークの構成は、次の手順で完了できます。1。ネットワークインターフェイスを構成し、IPコマンドを使用して、構成ファイルの永続性設定を一時的に設定または編集します。 2。固定IPを必要とするデバイスに適した静的IPを設定します。 3.ファイアウォールを管理し、iPtablesまたはFirewalldツールを使用してネットワークトラフィックを制御します。

メンテナンスモードは、Linuxシステム管理において重要な役割を果たし、修復、アップグレード、構成の変更を支援します。 1.メンテナンスモードを入力します。 Grubメニューから選択するか、コマンド「sudosystemctlisolaterscue.target」を使用できます。 2。メンテナンスモードでは、ファイルシステムの修理およびシステムの更新操作を実行できます。 3.高度な使用法には、ルートパスワードのリセットなどのタスクが含まれます。 4.メンテナンスモードに入ったり、ファイルシステムをマウントできないなどの一般的なエラーは、GRUB構成をチェックしてFSCKコマンドを使用して固定できます。

Linuxメンテナンスモードを使用するタイミングと理由:1)システムが起動するとき、2)主要なシステムの更新またはアップグレードを実行するとき、3)ファイルシステムメンテナンスを実行するとき。メンテナンスモードは、安全で制御された環境を提供し、運用上の安全性と効率を確保し、ユーザーへの影響を減らし、システムセキュリティを強化します。

Linuxの不可欠なコマンドは次のとおりです。1.LS:リストディレクトリの内容; 2.CD:作業ディレクトリを変更します。 3.mkdir:新しいディレクトリを作成します。 4.RM:ファイルまたはディレクトリを削除します。 5.CP:ファイルまたはディレクトリをコピーします。 6.MV:ファイルまたはディレクトリの移動または名前を変更します。これらのコマンドは、カーネルと対話することにより、ユーザーがファイルとシステムを効率的に管理するのに役立ちます。

Linuxでは、ファイルおよびディレクトリ管理ではLS、CD、MKDIR、RM、CP、MVコマンドを使用し、許可管理はCHMOD、CHOWN、およびCHGRPコマンドを使用します。 1。LS-Lなどのファイルおよびディレクトリ管理コマンドは、詳細情報、MKDIR-Pを再帰的に作成するディレクトリを再帰的に作成します。 2。CHMOD755FILEセットファイル許可、CHOWNUSERFILEファイル所有者、CHGRPGROUPFILEの変更ファイルグループなどの許可管理コマンド。これらのコマンドは、ファイルシステム構造とユーザーおよびグループシステムに基づいており、システムコールとメタデータを介して動作および制御します。

メンテナンスメモデンリンリンアスピアルブーテンビロンメント、criticalsystemmaincencetasks.itallowsadministratorstopertopertopertopersetstingtingpasswords、Repainingfilesystems、およびRecoveringfrombootfailurureSinaMinimalenvironment.

Linuxのコアコンポーネントには、カーネル、ファイルシステム、シェル、ユーザー、カーネルスペース、デバイスドライバー、パフォーマンスの最適化とベストプラクティスが含まれます。 1)カーネルは、ハードウェア、メモリ、プロセスを管理するシステムのコアです。 2)ファイルシステムはデータを整理し、Ext4、BTRFS、XFSなどの複数のタイプをサポートします。 3)シェルは、ユーザーがシステムと対話するためのコマンドセンターであり、スクリプトをサポートします。 4)システムの安定性を確保するために、ユーザースペースをカーネルスペースから分離します。 5)デバイスドライバーは、ハードウェアをオペレーティングシステムに接続します。 6)パフォーマンスの最適化には、システム構成とベストプラクティスのチューニングが含まれます。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

PhpStorm Mac バージョン
最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

VSCode Windows 64 ビットのダウンロード
Microsoft によって発売された無料で強力な IDE エディター

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

MantisBT
Mantis は、製品の欠陥追跡を支援するために設計された、導入が簡単な Web ベースの欠陥追跡ツールです。 PHP、MySQL、Web サーバーが必要です。デモおよびホスティング サービスをチェックしてください。

ドリームウィーバー CS6
ビジュアル Web 開発ツール

ホットトピック









