@@ -52,9 +52,19 @@ Vagrant.configure("2") do |config|
5252 CODEIGNITER_PATH="/var/www/codeigniter"
5353 PHP_VERSION=7.2
5454 PGSQL_VERSION=10
55+ #APT_PROXY="192.168.10.1:3142"
5556
5657 grep -q "127.0.0.1 ${VIRTUALHOST}" /etc/hosts || echo "127.0.0.1 ${VIRTUALHOST}" >> /etc/hosts
5758
59+ # Prepare to use APT Proxy
60+ if [ ! -z $APT_PROXY ]; then
61+ if [ ! -f /etc/apt/sources.list-origin ]; then
62+ cp /etc/apt/sources.list /etc/apt/sources.list-origin
63+ fi
64+ sed -i "s/archive.ubuntu.com/${APT_PROXY}/" /etc/apt/sources.list
65+ sed -i "s/security.ubuntu.com/${APT_PROXY}/" /etc/apt/sources.list
66+ fi
67+
5868 export DEBIAN_FRONTEND=noninteractive
5969
6070 echo "================================================================================"
@@ -114,11 +124,11 @@ Vagrant.configure("2") do |config|
114124 echo "Configuring Memcached and Redis"
115125 echo "================================================================================"
116126
117- sed -i "s/^bind 127.0.0.1 ::1 /#bind 127.0.0.1 :: 1/" /etc/redis/redis.conf
118- sed -i "s/^protected-mode yes/protected-mode no/" /etc/redis/redis.conf
119- sed -i "s/^-l 127.0.0.1/#-l 127.0.0.1/" /etc/memcached.conf
120- systemctl restart redis
121- systemctl restart memcached
127+ sed -i "s/^bind 127.0.0.1/#bind 127.0.0.1/" /etc/redis/redis.conf
128+ sed -i "s/^protected-mode yes/protected-mode no/" /etc/redis/redis.conf
129+ sed -i "s/^-l 127.0.0.1/#-l 127.0.0.1/" /etc/memcached.conf
130+ systemctl restart redis
131+ systemctl restart memcached
122132
123133 echo "================================================================================"
124134 echo "Configuring Virtual Hosts"
@@ -130,10 +140,13 @@ Vagrant.configure("2") do |config|
130140 mkdir -p "${CODEIGNITER_PATH}/writable/apache"
131141 chown -R vagrant:vagrant $CODEIGNITER_PATH
132142
133- if [ ! -d /home/vagrant/codeigniter ]; then ln -s $CODEIGNITER_PATH /home/vagrant/codeigniter; fi
143+ # Creates a symlink in the user home
144+ if [ ! -d /home/vagrant/codeigniter ]; then
145+ ln -s $CODEIGNITER_PATH /home/vagrant/codeigniter
146+ fi
134147
135- sed -i "s/^ APACHE_RUN_USER=www-data/APACHE_RUN_USER=vagrant/" /etc/apache2/envvars
136- sed -i "s/^ APACHE_RUN_GROUP=www-data/APACHE_RUN_GROUP=vagrant/" /etc/apache2/envvars
148+ sed -i "s/APACHE_RUN_USER=www-data/APACHE_RUN_USER=vagrant/" /etc/apache2/envvars
149+ sed -i "s/APACHE_RUN_GROUP=www-data/APACHE_RUN_GROUP=vagrant/" /etc/apache2/envvars
137150 grep -q "Listen 81" /etc/apache2/ports.conf || sed -i "s/^Listen 80/Listen 80\\ nListen 81\\ nListen 82/" /etc/apache2/ports.conf
138151
139152 echo "ServerName ${VIRTUALHOST}
0 commit comments