This commit is contained in:
William Mantly 2019-07-04 20:58:20 -04:00
parent 23a4e98668
commit 47caaa7a0a
Signed by: wmantly
GPG Key ID: E1EEC7650BA97160
10 changed files with 589 additions and 577 deletions

32
Vagrantfile vendored
View File

@ -61,25 +61,25 @@ Vagrant.configure("2") do |config|
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<~SHELL
if ! apt list ruby2.5 | grep installed; then
apt-add-repository ppa:brightbox/ruby-ng -y
apt-get update
sudo apt-get install -y build-essential resolvconf ruby2.5 ruby2.5-dev gem
fi
# if ! apt list ruby2.5 | grep installed; then
# apt-add-repository ppa:brightbox/ruby-ng -y
# apt-get update
# sudo apt-get install -y build-essential resolvconf ruby2.5 ruby2.5-dev gem
# fi
if ! which berks >/dev/null; then
gem install berkshelf --no-ri --no-rdoc
# ln -s /opt/chef/embedded/bin/berks /usr/local/bin/berks
fi
# if ! which berks >/dev/null; then
# gem install berkshelf --no-ri --no-rdoc
# # ln -s /opt/chef/embedded/bin/berks /usr/local/bin/berks
# fi
cd /vagrant
git submodule update --init --recursive
# cd /vagrant
# git submodule update --init --recursive
cd /vagrant/ops/cookbooks
rm -rf vendor
rm -rf $HOME/.berksfile
berks update
berks vendor vendor
# cd /vagrant/ops/cookbooks
# rm -rf vendor
# rm -rf $HOME/.berksfile
# berks update
# berks vendor vendor
SHELL
config.vm.provision 'chef_solo' do |chef|

View File

@ -3,6 +3,6 @@ cookbook_file '/tmp/datacom_abc.sql' do
end
execute 'Seed MySQL DB' do
command "mysql -h localhost -u\"#{node['db']['user']}\" -p\"#{node['db']['password']}\" \"#{node['db']['name']}\" < /tmp/datacom_abc.sql"
not_if "$(mysql -h 127.0.0.1 -uroot -p\"#{node['db']['root_password']}\" \"#{node['db']['name']}\" -sse \"select count(*) from test_dec;\") -gt 0"
command "mysql -h 127.0.0.1 -u\"#{node['db']['user']}\" -p\"#{node['db']['password']}\" \"#{node['db']['name']}\" < /tmp/datacom_abc.sql"
not_if "$(mysql -h 127.0.0.1 -u\"#{node['db']['user']}\" -p\"#{node['db']['password']}\" \"#{node['db']['name']}\" -sse \"select count(*) from test_dec;\") -gt 0"
end

View File

@ -3,6 +3,6 @@ cookbook_file '/tmp/datacom_abc.sql' do
end
execute 'Seed MySQL DB' do
command "mysql -h localhost -u\"#{node['db']['user']}\" -p\"#{node['db']['password']}\" \"#{node['db']['name']}\" < /tmp/datacom_abc.sql"
command "mysql -h localhost -uroot -p\"#{node['db']['root_password']}\" \"#{node['db']['name']}\" < /tmp/datacom_abc.sql"
not_if "$(mysql -h 127.0.0.1 -uroot -p\"#{node['db']['root_password']}\" \"#{node['db']['name']}\" -sse \"select count(*) from test_dec;\") -gt 0"
end

View File

@ -3,6 +3,6 @@ cookbook_file '/tmp/datacom_abc.sql' do
end
execute 'Seed MySQL DB' do
command "mysql -h localhost -u\"#{node['db']['user']}\" -p\"#{node['db']['password']}\" \"#{node['db']['name']}\" < /tmp/datacom_abc.sql"
command "mysql -h localhost -uroot -p\"#{node['db']['root_password']}\" \"#{node['db']['name']}\" < /tmp/datacom_abc.sql"
not_if "$(mysql -h 127.0.0.1 -uroot -p\"#{node['db']['root_password']}\" \"#{node['db']['name']}\" -sse \"select count(*) from test_dec;\") -gt 0"
end

View File

@ -1,11 +1,20 @@
[
'apache2',
'apache2-dev',
'libapache2-mod-wsgi-py3',
].each do |pkg|
apt_package pkg
end
if node['web']['wsgi']
[
'libapache2-mod-wsgi-py3',
].each do |pkg|
apt_package pkg
end
end
file '/etc/apache2/sites-enabled/000-default.conf' do
action :delete
end

View File

@ -11,11 +11,11 @@ end
bash 'Make mysql Database and User' do
code <<~EOH
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "CREATE DATABASE '#{node['db']['name']}' /*\!40100 DEFAULT CHARACTER SET utf8 */;"
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "CREATE USER '#{node['db']['user']}'@localhost IDENTIFIED BY '#{node['db']['password']}';"
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "GRANT ALL PRIVILEGES ON '#{node['db']['name']}'.* TO '#{node['db']['user']}'@'%';"
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "CREATE DATABASE #{node['db']['name']};"
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "CREATE USER #{node['db']['user']}@localhost IDENTIFIED BY '#{node['db']['password']}';"
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "GRANT ALL PRIVILEGES ON #{node['db']['name']}.* TO #{node['db']['user']}@localhost;"
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "FLUSH PRIVILEGES;"
EOH
not_if "mysql -h 127.0.0.1 -uroot -p\"#{node['db']['root_password']}\" -e 'use #{node['db']['name']}'"
# not_if "mysql -h 127.0.0.1 -uroot -p\"#{node['db']['root_password']}\" -e 'use #{node['db']['name']}'"
end

View File

@ -44,9 +44,10 @@
<% if node['web']['root'] %>
DocumentRoot <%= node['web']['root'] %>
<Directory <%= node['web']['root'] %>/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<% end -%>

View File

@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'http://demo.phpwebsite.in/abc/';
$config['base_url'] = 'http://localhost';
/*
|--------------------------------------------------------------------------

6
php/application/config/database.php Normal file → Executable file
View File

@ -76,9 +76,9 @@ $query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'phpwe4km_abc',
'password' => 'VOtMA5$_88-Y',
'database' => 'phpwe4km_abc',
'username' => 'datacom_abc',
'password' => '3dba6d57248e16ccd0b187383e',
'database' => 'datacom_abc',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,

File diff suppressed because it is too large Load Diff