-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_wordpress.sh
More file actions
59 lines (50 loc) · 1.34 KB
/
install_wordpress.sh
File metadata and controls
59 lines (50 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# install_wordpress.sh
# Run this function in the web root folder
# Works for apache
wget http://wordpress.org/latest.tar.gz;
tar xvfz latest.tar.gz;
rm latest.tar.gz;
mv wordpress wp;
rm -rf wp/wp-content/plugins/akismet;
echo 'User-agent: *' > robots.txt;
echo 'Allow: /' > robots.txt;
sed -i 's/wp-blog-header.php/wp\/wp-blog-header.php/g' index.php;
printf '.htaccess\nwp/wp-config.php\n' >> .gitignore;
cat <<EOF >> .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
EOF
cat <<EOF >> index.php
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require('./wp/wp-blog-header.php');
?>
EOF
cat <<EOF >> README.md
# After install instructions
Thank you for using this script to install Wordpress!
## Next steps:
- Create a database
- Add the database name and credentials to wp/wp-config.php
- Go to your site and finish the Wordpress install script.
EOF