Server/WordPress: Unterschied zwischen den Versionen
Zeile 136: | Zeile 136: | ||
---- | ---- | ||
$EDITOR /usr/local/etc/apache24/Includes/php.conf | |||
<pre> | <pre> | ||
<IfModule dir_module> | <IfModule dir_module> |
Version vom 19. April 2016, 06:40 Uhr
- Achtung
Dieser Artikel ist ein exemplarischer Artikel.
Installation
- OS
- FreeNAS 9.3
- Paketverwaltung
- freebsd-man:pkgng
Randbedingungen
Methoden der Installation
Installation mit pkg
pkg upgrade -y
pkg install -y wordpress
pkg install -y apache24
sysrc apache24_enable=yes
service apache24 start
…
Installation als FAMP
pkg upgrade -y
pkg install -y apache24
sysrc apache24_enable=yes
service apache24 start
pkg install -y mysql56-server
sysrc mysql_enable=yes
service mysql-server start
mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! Cleaning up...
pkg install -y mod_php56 php56-mysql php56-mysqli
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
rehash
pkg search php56
pkg install -y php56
$EDITOR /usr/local/etc/apache24/Includes/php.conf
<IfModule dir_module> DirectoryIndex index.php index.html <FilesMatch "\.php$"> SetHandler application/x-httpd-php </FilesMatch> <FilesMatch "\.phps$"> SetHandler application/x-httpd-php-source </FilesMatch> </IfModule>
service apache24 restart
echo '<?php phpinfo(); ?>' > /usr/local/www/apache24/data/info.php
http://<IP>/info.php
rm /usr/local/www/apache24/data/info.php
pkg install -y php56-mysql php56-xml php56-hash php56-gd php56-curl php56-tokenizer php56-zlib php56-zip
mysql -u root -p
CREATE DATABASE wp;
CREATE USER wpu@localhost IDENTIFIED BY 'w0rdpr3ss';
GRANT ALL PRIVILEGES ON wp.* TO wpu@localhost;
FLUSH PRIVILEGES;
exit
cd /tmp
fetch http://wordpress.org/latest.tar.gz
tar xvf latest.tar.gz
rm latest.tar.gz
cd /tmp/wordpress
cp wp-config-sample.php wp-config.php
$EDITOR wp-config.php
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'wp'); /** MySQL database username */ define('DB_USER', 'wpu'); /** MySQL database password */ define('DB_PASSWORD', 'w0rdpr3ss');
cp -rp /tmp/wordpress/* /usr/local/www/apache24/data/
chown -R www:www /usr/local/www/apache24/data/*
http://<IP>/
http://<IP>/index.html
http://<IP>/index.php
rm /usr/local/www/apache24/data/
http://<IP>/
$EDITOR /usr/local/etc/apache24/httpd.conf
LoadModule rewrite_module libexec/apache24/mod_rewrite.so #LoadModule rewrite_module libexec/apache24/mod_rewrite.so
<Directory "/usr/local/www/apache24/data">
AllowOverride All
service apache24 restart
touch /usr/local/www/apache24/data.htaccess
chown www:www /usr/local/www/apache24/data.htaccess