Can't reach wordpress on vagrant - wordpress

I'm using Vagrant to setup a VM with a LAMP stack and Wordpress on top, but I can't access the Wordpress website from the host machine on http://localhost:8000. I can access HTML files i put in /var/www. Am I missing something?
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8000, auto_correct: true
config.vm.network "forwarded_port", guest: 443, host: 44300, auto_correct: true
config.vm.network "forwarded_port", guest: 3306, host: 33060, auto_correct: true
config.vm.provision :shell, path: "bootstrap.sh"
end
bootstrap.sh
#!/usr/bin/env bash
echo -e "\n--- Starting VM bootstrapping... ---\n"
echo -e "\n--- Add repos ---\n"
add-apt-repository ppa:ondrej/apache2 > /dev/null 2>&1
add-apt-repository ppa:ondrej/php5-5.6 > /dev/null 2>&1
sudo add-apt-repository ppa:ondrej/mysql-5.6 > /dev/null 2>&1
echo -e "\n--- Update ---\n"
apt-get -qq update
echo -e "\n--- Installing Apache, PHP and PHP specific packages --- \n"
apt-get -y install apache2 php5 php5-curl php5-mcrypt php5-mysql php5-xdebug > /dev/null 2>&1
echo -e "\n--- Install MySQL Server ---\n"
apt-get -y install debconf-utils > /dev/null 2>&1
debconf-set-selections <<< "mysql-server mysql-server/root_password password root"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password root"
apt-get -y install mysql-server > /dev/null 2>&1
echo -e "\n--- Enable mod-rewrite ---\n"
a2enmod rewrite
echo -e "\n--- Create Virtual Host ---\n"
cat > "/etc/apache2/sites-available/000-default.conf" << EOF
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName localhost
DocumentRoot /var/www
<Directory /var/www>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EOF
echo -e "\n--- Change apache user to vagrant user ---\n"
sed -i 's/APACHE_RUN_USER=www-data/APACHE_RUN_USER=vagrant/' /etc/apache2/envvars
sed -i 's/APACHE_RUN_GROUP=www-data/APACHE_RUN_GROUP=vagrant/' /etc/apache2/envvars
echo -e "\n--- Restarting Apache ---\n"
service apache2 restart
# Other packages
echo -e "\n--- Install other useful packages ---\n"
apt-get -y install git > /dev/null 2>&1
# ENV Setup stops here, APP setup starts.
echo -e "\n--- Starting App bootstraping... ---\n"
rm -rf /var/www/*
cd /var/www
echo -e "\n--- Install Composer for PHP package management ---\n"
curl --silent https://getcomposer.org/installer | php > /dev/null 2>&1
mv composer.phar /usr/local/bin/composer
echo -e "\n--- Install WP-CLI ---\n"
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > /dev/null 2>&1
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
echo -e "\n--- Install WP ---\n"
wp core download --allow-root
wp core config --dbuser=root --dbpass=root --dbname=mkp --allow-root
wp db create --allow-root
wp core install --url=localhost --title=Example --admin_user=admin --admin_password=root --admin_email=john#example.com --allow-root
echo -e "\n--- Symlink to /vagrant folder ---\n"
sudo ln -fs /vagrant /var/www/wp-content/themes/mytheme
#cd /vagrant
#
echo -e "\n--- Changing permissions and ownership where needed ---\n"
sudo chmod 777 -R .
sudo chown -R $USER:$USER .
Edit:
curl -v http://localhost:8000outputs the following:
* Rebuilt URL to: http://localhost:8000/
* Adding handle: conn: 0x22853e0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x22853e0) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8000 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.33.0
> Host: localhost:8000
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 15 Jul 2015 13:06:15 GMT
* Server Apache/2.4.12 (Ubuntu) is not blacklisted
< Server: Apache/2.4.12 (Ubuntu)
< X-Pingback: http://localhost/xmlrpc.php
< Location: http://localhost/
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
<
* Connection #0 to host localhost left intact

The problem is your website is sending back a redirect, back to the default port 80. see the curl output line:
Location: http://localhost/
If you dont have a webserver on localhost, you can use a transparent localhost port 80 to VM port 80 mapping. Or configure something in apache or wordpress to use port 8000 and make that the transparent port.

Related

docker run can't find application

my project structure is:
/docker-test
/app
/static
....
/templates
....
-__init__.py
....
-nginx.conf
-supervisord.conf
-uwsgi.ini
-Dockerfile
-app.py
-requirements.txt
I normally run the app by going into /docker-test>python app.py
Dockerfile:
FROM python:2.7
# Install uWSGI
RUN pip install uwsgi
# Standard set up Nginx
ENV NGINX_VERSION 1.9.11-1~jessie
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
&& echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y ca-certificates nginx=${NGINX_VERSION} gettext-base \
&& rm -rf /var/lib/apt/lists/*
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
EXPOSE 80 443
# Finished setting up Nginx
# Make NGINX run on the foreground
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
# Remove default configuration from Nginx
RUN rm /etc/nginx/conf.d/default.conf
# Copy the modified Nginx conf
COPY nginx.conf /etc/nginx/conf.d/
# Copy the base uWSGI ini file to enable default dynamic uwsgi process number
COPY uwsgi.ini /etc/uwsgi/
# Install Supervisord
RUN apt-get update && apt-get install -y supervisor \
&& rm -rf /var/lib/apt/lists/*
# Custom Supervisord config
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY . /deploy
WORKDIR /deploy
RUN pip install -r /deploy/requirements.txt
CMD ["/usr/bin/supervisord"]
app.py:
#!flask/bin/python
from app import app
from flask import url_for
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True, port=80)
app.add_url_rule('/favicon.ico', edirect_to=url_for('static', filename='favicon.ico'))
supervidord.conf:
[supervisord]
nodaemon=true
[program:uwsgi]
command=/usr/local/bin/uwsgi --ini /etc/uwsgi/uwsgi.ini --ini /deploy/uwsgi.ini
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:nginx]
command=/usr/sbin/nginx
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
nginx.conf:
server {
location / {
include uwsgi_params;
uwsgi_pass unix:///tmp/uwsgi.sock;
}
}
uwsgi.ini:
[uwsgi]
wsgi-file=/app.py
socket = /tmp/uwsgi.sock
chown-socket = nginx:nginx
chmod-socket = 664
cheaper = 2
processes = 16
I am able to docker build and run without issue.
I get 500 error when trying to access the app in chrome:
no python application found
What is your current working directory? This just sounds like wsgi-file=/app.py should be wsgi-file=./app.py or you need to reference the correct absolute location such as wsgi-file=/deploy/app/app.py.

In vagrant can not access to the default keystone site with nginx

The vagrant server I configure with the following script still serve the default nginx page instead of the default keystone page.
Here the scripts I use:
The vagrant file:
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.network "private_network", ip: "192.168.1.10"
config.vm.provider "virtualbox" do |vb|
config.vm.provision "file", source: "mongodb-org-3.2.repo", destination: "~/mongodb-org-3.2.repo"
config.vm.provision "shell", path: "provision.sh"
end
The provision file:
sudo yum -y update
sudo hostnamectl set-hostname melanie
echo "given hostname :"
hostnamectl status --static
echo -e "\e[1;34m
***************************************************
add host names
***************************************************"
sudo cp /etc/hosts /etc/hosts.origin
echo "192.168.1.10 melanie.misite.com melanie" | sudo tee -a /etc/hosts > /dev/null
echo -e "\e[1;34mIP, FQDN and Server name setted in /etc/hosts:"
cat /etc/hosts
echo -e "\e[1;34m
***************************************************
set timezone
***************************************************"
sudo timedatectl set-timezone America/Guayaquil
echo -e "\e[1;34msetted time zone:"
timedatectl | grep "Time zone"
echo -e "\e[1;34m
***************************************************
add automatic security update
***************************************************"
sudo yum -y install yum-cron
sudo sed -i.bak 's/.*update_cmd =.*/update_cmd = security/' /etc/yum/yum-cron.conf
sudo sed -i.bak 's/.*apply_updates =.*/apply_updates = yes/' /etc/yum/yum-cron.conf
sudo sed -n /update_cmd/p /etc/yum/yum-cron.conf
sudo sed -n /apply_updates/p /etc/yum/yum-cron.conf
sudo systemctl status yum-cron
sudo systemctl start yum-cron
echo -e "\e[1;34m
***************************************************
create limited user account
***************************************************"
sudo useradd me
sudo echo me:admin | chpasswd
echo -e "\e[1;34m
***************************************************
SSH Dameon Options
***************************************************"
sudo sed -i.bak 's/.*PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
echo yum-cron.conf modified parameters:
sudo sed -n /PermitRootLogin/p /etc/ssh/sshd_config
systemctl restart sshd
echo -e "\e[1;34m
***************************************************
installing fail2ban
***************************************************"
sleep 15 #put sleep hoping it will help to fail2ban to be installed => do not work
sudo yum -y install fail2ban
sudo yum -y install sendmail
sudo systemctl start fail2ban
sudo systemctl enable fail2ban
systemctl start sendmail
systemctl enable sendmail
cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sed 's/.*backend =*/backend = systemd./' /etc/fail2ban/jail.local
echo -e "\e[1;34m
***************************************************
installing nginx
***************************************************"
sudo yum -y install epel-release
sudo yum -y install nginx
sudo systemctl start nginx
echo -e "\e[1;34m
***************************************************
configure nginx
***************************************************"
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup
sudo mkdir /etc/nginx/sites-available
sudo mkdir /etc/nginx/sites-enabled
sudo mkdir /var/www/misite.com/logs
sudo cp /home/vagrant/misite.conf /home/vagrant/misite.com
sudo mv /home/vagrant/misite.com /etc/nginx/sites-available > /dev/null
sudo ln -s /etc/nginx/sites-available/misite.com /etc/nginx/sites-enabled
sudo rm -rf /etc/nginx/sites-available/default
sudo chown -R nginx:nginx /var/www
sudo service nginx restart > /dev/null
echo -e "\e[1;34m
***************************************************
installing nodejs
***************************************************"
sudo yum -y install npm
sudo yum -y install nodejs
node --version
echo -e "\e[1;34m
***************************************************
installing mongoDB
***************************************************"
sudo mv /home/vagrant/mongodb-org-3.2.repo /etc/yum.repos.d/mongodb-org-3.2.repo
sudo yum -y install mongodb-org
systemctl start mongod
systemctl status mongod
echo -e "\e[1;34m
***************************************************
installing keystone
***************************************************"
sudo npm install -g yo
sudo mkdir /var/www
sudo mkdir /var/www/misite.com
cd /var/www/misite.com
sudo npm install -g generator-keystone
sudo chown -R vagrant:vagrant /var/www/
The nginx server conf file (/etc/nginx/sites-available/misite.com):
Here the keystone site should be redirect to the port 80 of the vagrant server (I think the mistake is in this file but can not see where)
# IP which nodejs is running on
upstream app_misite.com {
server 0.0.0.0:3000;
}
# nginx server instance
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name localhost;
access_log /var/www/misite.com/logs/access.log;
error_log /var/www/misite.com/logs/error.log;
location / {
root /var/www/misite.com;
index index.html index.htm;
try_files $uri $uri/ #node;
}
location #node {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://app_misite.com;
}
}
I also remove the default keyword from the /etc/nginx/nginx.conf
Then:
vagrant ssh
[vagrant#melanie ~]$cd /var/www/misite.com
[vagrant#melanie misite.com]$ yo keystone
[vagrant#melanie misite.com]$ node keystone
And I have keystone js running:
------------------------------------------------
KeystoneJS Started:
My Site is ready on http://0.0.0.0:3000
------------------------------------------------
But still see the default nginx page from http://192.168.1.10/
Any help will be appreciate.
Disclaimer: I'm not familiar with Nginx, I'm trying to see if it may be settings with Keystone that are affecting the port it is running on versus Nginx.
Keystone defaults to port 3000 (more specifically, process.env.PORT || 3000), unless you specify another one. If you can set the environment variable of port to whatever value you want (80 in this case), that should make it work on http://192.168.1.10:80/.
process.env.PORT = 3000
Looking at your nginx server conf file also shows this:
upstream app_misite.com {
server 0.0.0.0:3000;
}
Try changing :3000 to :80.
I think you have cupple of issues :
nginx installed on centos has a default nginx.conf file with a server directive so you cannot override this directive in your config misite file.
You need to remove the server default declaration in /etc/nginx/nginx.conf file or you can just use your provisioning script to copy a new default conf file without server declaration
I am also not even sure if the default file has an include directive on sites-available directory (look if you have include /etc/nginx/sites-enabled/*; in your conf file)
when you create the keystone app, it does not contain the /var/www/misite.com/logs/ directory and log file, I do not see you create them in your script so nginx will fail on this (btw you can create a directory structure with mkdir -pv single command)
The keystone app you created is owned by vagrant. Make sure vagrant is added to nginx group otherwise you might get a Forbidden exception when accessing your site
can help on centos if you dont want to fight with SELinux, just disabled it on a dev instance. edit the /etc/sysconfig/selinux and just set SELINUX=disabled

WordPress Docker Proxy Error 502 : The proxy server received an invalid response from an upstream server

Working on WordPress, We put a project on docker.
I had a 502 proxy error. I was able to fix it restarting docker. However, the problem is still here on coworkers installation.
I try to fix it. However, I can not recreate the bug, so I have no log for this error.
Here is the dockerfile:
FROM debian:8
MAINTAINER xxxxxxxxxxxxx
LABEL version="1.0"
LABEL description="Debian 8 / Apache 2 / PHP 5"
ARG DEBIAN_FRONTEND=noninteractive
ENV DOCKER_CONTAINER_APP=/var/www
RUN apt-get -y update && apt-get install -y \
apache2 \
php5 \
libapache2-mod-php5 \
mysql-server \
php5-mysql \
supervisor \
phpmyadmin
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
RUN /usr/sbin/mysqld & \
sleep 10s &&\
echo "GRANT ALL ON *.* TO admin#'%' IDENTIFIED BY 'heliopsis' WITH GRANT OPTION; FLUSH PRIVILEGES" | mysql
EXPOSE 3306
CMD ["/usr/bin/mysqld_safe"]
COPY ressources/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ressources/my.cnf /etc/mysql/my.cnf
COPY ressources/init.sql /tmp/init.sql
RUN /etc/init.d/mysql start && mysql -uroot < /tmp/init.sql && /etc/init.d/mysql stop
COPY sql-dumps /tmp/sql-dumps
RUN /etc/init.d/mysql start && gunzip < /tmp/sql-dumps/dump.sql.gz | mysql -uroot -D nalian-local && /etc/init.d/mysql stop
RUN /etc/init.d/mysql start && mysql -uroot -e "SET PASSWORD = PASSWORD('heliopsis');" && /etc/init.d/mysql stop
# Dev env : show errors
RUN sed -i -e 's/^error_reporting\s*=.*/error_reporting = E_ALL/' /etc/php5/apache2/php.ini
RUN sed -i -e 's/^display_errors\s*=.*/display_errors = On/' /etc/php5/apache2/php.ini
RUN a2enmod rewrite
RUN mkdir /etc/apache2/ssl
COPY ressources/vhost /etc/apache2/sites-available/000-default.conf
RUN a2ensite 000-default
# add our local files in docker instance
ADD . $DOCKER_CONTAINER_APP
# add the docker instance as a volume
VOLUME $DOCKER_CONTAINER_APP
# define the workspace of the container
WORKDIR $DOCKER_CONTAINER_APP
# launching apache # startup
CMD cd wp-content; tar xzf $DOCKER_CONTAINER_APP/ressources/uploads.tar.gz; cd ..; ln -s wp-config-dev.php wp-config.php; ln -s htaccess_dev .htaccess;/usr/bin/supervisord
The install-vhost.sh :
#!/usr/bin/env bash
if [ -z "$1" ]
then
echo "dev name required"
exit
fi
if [ -z "$2" ]
then
echo "HTTP port required"
exit
fi
VHOST_TEMPLATE=`find . -name "*.DEV.rocks.conf"`
VHOST=`echo $VHOST_TEMPLATE | sed 's/.*\///' | sed "s/DEV/$1/"`
sudo cat $VHOST_TEMPLATE | replace "DEV" "$1" | replace "PORT" "$2" > /etc/apache2/sites-available/$VHOST
sudo a2ensite $VHOST
sudo service apache2 restart
And the vhost :
############## www.nalian.coralie.rocks
<VirtualHost *:80>
ServerName www.nalian.coralie.rocks
<Proxy *>
Allow from localhost
</Proxy>
ProxyPass / http://localhost:1250/
ProxyPassReverse / http://localhost:1250/
ProxyPreserveHost On
</VirtualHost>
Do you have any idea to help me?

Vagrant - centos networking

I have set up a Vagrant machine with this configuration --
Vagrant.configure("2") do |config|
config.vm.box = "intprog/centos7-ez6"
config.ssh.insert_key = false
config.vm.network "public_network", ip: "192.168.33.243"
config.vm.provision "file", source: "/server/bin/nginx/conf/domains-enabled/cemcloudMigration.conf", destination: "~/cemcloud.conf"
config.vm.provision "shell", path: "webroot/bootstrap/script.sh"
end
This is how my script looks like -- sudo su
#update the centos version
#yum update -y
yum -y erase httpd httpd-tools apr apr-util
#getting nginx from the right address
yum install -y http://http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.10.0-1.el7.ngx.x86_64.rpm
yum install -y nginx
#installing composer
curl -sS https://getcomposer.org/installer | php
chmod +x composer.phar
mv composer.phar /usr/bin/composer
cd /srv/www/cemcloud2
composer install
#removal of old mariadb5.5 and installation of the new one
yum -y remove mariadb-server mariadb mariadb-libs
yum clean all
yum -y install MariaDB-server MariaDB-client
#clear unnecessary software
yum -y remove varnish
## restart the service
service mysql restart
service php-fpm restart
service nginx restart
/var/log/nginx/access.log is producing this --
10.0.2.2 - - [17/Oct/2016:11:42:10 +0000] "GET / HTTP/1.1" 301 185 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101
Firefox/51.0" "-"
Really strange behavior from nginx because it some times produces log and sometimes it doesn't. When I open up my firefox developer it produces log and when I am on google chrome it doesn't.
Every time I put in the URL into browser it says
the connection has timed out.
Anyhow I want to get connected to this machine. What am I doing wrong ??
Please check your network on the guest-mashine with:
nmap -sT -O localhost
Check if the ports your are using in your nginx configuration are open.
If not, open them in your firewall and check again.
It was a firewall issue inside this machine "intprog/centos7-ez6". It wasn't listening to the port https.
I have followed those steps:
firewall-cmd --add-service=https
firewall-cmd --add-service=https --permanent
firewall-cmd --reload
and it all worked.

hosting an mvc app within vagrant

Maybe it's just because it's a Friday and it's after closing time but I've been stuck on this for an hour and can't quite get it working. I'm using Vagrant with an application we're building - the git repo contains the Vagrantfile and a Laravel application. We have /deploy, /tests, and /src directories; the actual Laravel framework lives in /src. On my local machine, I have set up a VirtualHost that let's me access the application by browsing to localhost:9000:
Listen 8081
<VirtualHost *:8081>
DocumentRoot "/Application/mamp/apache2/htdocs/myapp/src/public"
ServerName localhost
<Directory "/Application/mamp/apache2/htdocs/myapp/src/public">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Works like a charm. So I copied the relevant bits to my Vagrant setup:
Listen 8081
<VirtualHost *:8081>
DocumentRoot "/var/www/src/public"
ServerName localhost
<Directory "/var/www/src/public">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
My Vagrantfile looks like this:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.provision :shell, :path => "vagrant/main.sh"
config.vm.network "private_network", ip: "192.168.100.101", virtualbox__intnet: true
end
And my vagrant/main.sh file looks like this:
#!/usr/bin/env bash
apt-get update
echo mysql-server-5.5 mysql-server/root_password password notthepassword | debconf-set-selections
echo mysql-server-5.5 mysql-server/root_password_again password notthepassword | debconf-set-selections
apt-get install -y mysql-common mysql-server mysql-client
apt-get install -y apache2
apt-get install -y php5 libapache2-mod-php5
apt-get install -y php5-mysql php5-curl php-pear php5-imagick php5-mcrypt php5-memcache
apt-get install -y vim
a2enmod rewrite
sed -i -e 's/AllowOverride None/AllowOverride All/g' /etc/apache2/sites-available/default
cp /vagrant/vagrant/bgs /etc/apache2/sites-available
a2ensite bgs
/etc/init.d/apache2 restart
rm -rf /var/www
ln -fs /vagrant /var/www
Once it's all up and running I can ping 192.168.100.101. But it's not serving any HTML - if I browse to that address in Chrome, I get a "no data received" error. If I go to 192.168.100.101:8081 Chrome says it can't find the address. How can I configure everything to play nice together and let me clone my repo, run vagrant up, and browse to 192.168.100.101:8081 and see my app?
(Also: I even added a port forwarding line in there to go from guest:8081 to host:8081. That generated an HTTP 500 error ("The server encountered an internal error or misconfiguration and was unable to complete your request."). Not sure if that's progress or not.
Turns out there was a number of things happening all at once:
I was using Ubuntu 12 LTS, which had a version of PHP a little to old to run the edge release of Laravel. Installing an upgraded version of PHP fixed that.
The virtualbox__intnet directive was...wrong. Somehow. Changed that whole Vagrantfile line to: config.vm.network "private_network", :ip => "192.168.100.101", :auto_network => true
The different ports, mucking about in the various symlinked directories vs. apache config directories...needlessly complicated.
Here's my final setup, in case anyone else has this exact, specific problem:
Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "puppetlabs/ubuntu-13.10-64-puppet"
config.vm.provision :shell, :path => "vagrant/main.sh"
config.vm.network "private_network", :ip => "192.168.100.101", :auto_network => true
end
main.sh:
#!/usr/bin/env bash
apt-get update
echo mysql-server-5.5 mysql-server/root_password password f6b6rWixbu99CtQ | debconf-set-selections
echo mysql-server-5.5 mysql-server/root_password_again password f6b6rWixbu99CtQ | debconf-set-selections
apt-get install -y mysql-common mysql-server mysql-client apache2 php5 libapache2-mod-php5 php5-mysql php5-curl php-pear php5-imagick php5-mcrypt php5-memcache php5-json
a2enmod rewrite
sed -i -e 's/AllowOverride None/AllowOverride All/g' /etc/apache2/sites-available/default
cp /vagrant/vagrant/app.conf /etc/apache2/sites-available
a2ensite app.conf
#fix for ubuntu 13.10: http://stackoverflow.com/questions/19446679/mcrypt-not-present-after-ubuntu-upgrade-to-13-10
ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini
php5enmod mcrypt
#/fix
#json licensing snafu: http://stackoverflow.com/questions/18239405/php-fatal-error-call-to-undefined-function-json-decode
php5enmod json
#/snafu
#may need to be done on the host OS, not the guest: http://stackoverflow.com/questions/17954625/services-json-failed-to-open-stream-permission-denied-in-laravel-4
chmod -R 0777 /vagrant/src/app/storage
rm -rf /var/www
ln -fs /vagrant/src/public /var/www
/etc/init.d/apache2 restart
Apache site configuration copied in:
<VirtualHost *:80>
DocumentRoot "/var/www"
ServerName localhost
<Directory "/var/www">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
(BTW, though this config looks very similar to the default apache configuration, I found it was easier and more extensible to create a config for whatever project I happen to be working on, and if I need to expand on the options for a future project, I can.)

Resources