Skip to content

Instantly share code, notes, and snippets.

@zachwright
Last active March 25, 2021 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zachwright/e26e5299d97dc7c4d59b144530775f71 to your computer and use it in GitHub Desktop.
Save zachwright/e26e5299d97dc7c4d59b144530775f71 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment