-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
51 lines (41 loc) · 1.69 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Vagrant.configure("2") do |config|
config.vm.box = "generic/gentoo"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = "4"
vb.customize ["modifyvm", :id, "--audio", "none"]
#vb.customize ["sharedfolder", "add", :id, "--name", "vagrant", "--hostpath", "/home/user/tmp/share", "--automount" ]
end
config.vm.provision "shell", inline: <<-SHELL
emerge --sync
emerge --update world
# Install misc apps
emerge app-misc/tmux app-misc/mc net-analyzer/mtr sys-process/htop dev-vcs/git dev-db/redis
# todo: add wkhtmltopdf
# emerge media-gfx/wkhtmltopdf
echo "PHP_TARGETS=\"php7-4\"" | tee -a /etc/portage/make.conf
echo "USE=\"apache2\"" | tee -a /etc/portage/make.conf
emerge --update --changed-use --deep @world
# https://wiki.gentoo.org/wiki/PHP
USE="xml zip zlib mysql mysqli apache2 cli" emerge dev-lang/php dev-php/xdebug
#eselect php list cli
# https://wiki.gentoo.org/wiki/Apache
emerge www-servers/apache
sed -e "s|APACHE2_OPTS=\"|APACHE2_OPTS=\"-D PHP -D DEFAULT_VHOST -D INFO|" /etc/conf.d/apache2 | sudo tee /etc/conf.d/apache2
#chown apache:apache /var/www/sitename
# insert multiline example
# cat <<EOT >> greetings.txt
# line 1
# EOT
rc-update add apache2 default
/etc/init.d/apache2 restart
# show runing apache2
netstat -tulpen | grep apache
# https://wiki.gentoo.org/wiki/MySQL/en
# emerge dev-db/mysql
# /etc/init.d/mysql start
# rc-update add mysql default
# /usr/bin/mysqladmin -u root -h localhost password 'root'
SHELL
config.vm.synced_folder "./data", "/var/www/localhost/htdocs/", group: 1002, mount_options: ["dmode=775,fmode=775"]
end