Skip to content

Instantly share code, notes, and snippets.


rilwis/vhost.bat Secret

Last active November 26, 2016 02:30
What would you like to do?
@echo OFF
SET ApacheConf=C:\xampp\apache\conf\extra\httpd-vhosts.conf
SET InstallPath=D:\Sites\
SET MysqlUsername=root
SET MysqlPassword=
SET SiteTitle=%1
SET AdminUsername=admin
SET AdminPassword=admin
echo.>> %SYSTEMROOT%\System32\drivers\etc\hosts
echo.^<VirtualHost *:80^>>> %ApacheConf%
echo. DocumentRoot "%InstallPath%">> %ApacheConf%
echo. ServerName>> %ApacheConf%
echo.^</VirtualHost^>>> %ApacheConf%
mysqladmin -u %MysqlUsername% --password="%MysqlPassword%" create %1
if not exist "%InstallPath%" mkdir %InstallPath%
cd /d %InstallPath%
wp core download && wp core config --dbname=%1 --dbuser=%MysqlUsername% --dbpass=%MysqlPassword% && wp core install --title=%SiteTitle% --admin_user=%AdminUsername% --admin_password=%AdminPassword% --admin_email=%AdminEmail%
echo Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment