Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codebycliff/f46498a639ccae00e0818d195851ac91 to your computer and use it in GitHub Desktop.
Save codebycliff/f46498a639ccae00e0818d195851ac91 to your computer and use it in GitHub Desktop.
Setting up Apache WordPress Sites

Apache Server WordPress Sites

Things to remember when setting up a WordPress site on an Apache server

First add url to hosts

/etc/hosts add local url to 127.0.0.1

Second add virtual host

/etc/apache2/extra/httpd-vhosts.conf add vhost config for site - If Wordpress/bedrock the path needs to be the projectfolder/web

At this point, run sudo apachectl restart to restart apache. (anytime you mess with apache config files)

Third add .htaccess

.htaccess file with default Wordpress rules added to the web folder

Fourth set up database

Secure database dump, Find and replace prod domain with local domain in sql, and import into Sequel Pro

  • Specifically, update the site_url and home fields in the _options table.

Fifth set up .env

  • If Bedrock: In .env, the DB_USER and DB_PASSWORD are your MYSQL credentials (Zach look in last pass you saved it there)
  • If Vanilla: In wp-config.php, the DB_USER and DB_PASSWORD are your MYSQL credentials (Zach look in last pass you saved it there)

Permissions

  • MAKE SURE TO CHECK FOLDER PERMISSIONS FOR UPLOADS SO THAT WORDPRESS CAN UPLOAD TO IT

Troubleshooting

If you are experiencing redirect issues or issues in general, try disabling ithemes-security-pro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment