Docker Install: Difference between revisions
Jump to navigation
Jump to search
| (35 intermediate revisions by the same user not shown) | |||
| Line 12: | Line 12: | ||
</pre> | </pre> | ||
==UPDATE== | ==UPDATE== | ||
<pre> | |||
apt update && upgrade | apt update && upgrade | ||
apt install wget nano curl libpam-modules-bin libpam-modules libpam-runtime libpam0g libsystemd0 libudev1 zip rar htop net-tools imagemagick php-gd | apt install wget nano curl libpam-modules-bin libpam-modules libpam-runtime libpam0g libsystemd0 libudev1 zip rar gzip pigz tar htop net-tools imagemagick php-gd python3 cron libpython3.14-minimal libpython3.14-stdlib python3.14-minimal python3.14 php-fpm | ||
</pre> | |||
==Lampp== | ==Lampp== | ||
<pre> | |||
cd /opt && wget https://excellmedia.dl.sourceforge.net/project/xampp/XAMPP%20Linux/8.2.12/xampp-linux-x64-8.2.12-0-installer.run && chmod 77 xampp-linux-x64-8.2.12-0-installer.run && ./xampp-linux-x64-8.2.12-0-installer.run | cd /opt && wget https://excellmedia.dl.sourceforge.net/project/xampp/XAMPP%20Linux/8.2.12/xampp-linux-x64-8.2.12-0-installer.run && chmod 77 xampp-linux-x64-8.2.12-0-installer.run && ./xampp-linux-x64-8.2.12-0-installer.run | ||
</pre> | |||
change user / group in httpd.conf as www-data | change user / group in httpd.conf as www-data | ||
==ProFTP== | ==ProFTP== | ||
<pre> | |||
useradd admin | useradd admin | ||
passwd admin | passwd admin | ||
| Line 26: | Line 31: | ||
chown root:ftp htdocs | chown root:ftp htdocs | ||
chmod 775 htdocs | chmod 775 htdocs | ||
</pre> | |||
==Mysql== | ==Mysql== | ||
Separate container | * Separate container | ||
Assign IP (Refer earlier) | * Assign IP (Refer earlier) | ||
> map > mkdir /opt/www -> /volume1/www | * > map > mkdir /opt/www -> /volume1/www | ||
Restore | Restore | ||
<pre> | |||
./mysql -u rajplus -p -h localhost ak_wiki </opt/www/backup/mysql/ak_wiki.sql | ./mysql -u rajplus -p -h localhost ak_wiki </opt/www/backup/mysql/ak_wiki.sql | ||
</pre> | |||
==phpmyadmin== | ==phpmyadmin== | ||
Edit /etc/extra/httpd-xampp.conf | * Edit /etc/extra/httpd-xampp.conf | ||
<pre> | |||
Require all granted | Require all granted | ||
Access throug web interface and add user and block root | </pre> | ||
* Access throug web interface and add user and block root | |||
<pre> | |||
mkdir /opt/save | mkdir /opt/save | ||
mkdir /opt/upload | mkdir /opt/upload | ||
</pre> | |||
Edit Config.inc.php | * Edit Config.inc.php | ||
<pre> | |||
declare(strict_types=1); | declare(strict_types=1); | ||
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */ | $cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */ | ||
| Line 57: | Line 67: | ||
$cfg['UploadDir'] = '/opt/upload'; | $cfg['UploadDir'] = '/opt/upload'; | ||
$cfg['SaveDir'] = '/opt/save'; | $cfg['SaveDir'] = '/opt/save'; | ||
</pre> | |||
==APCU == | ==APCU == | ||
<pre> | |||
apt install php8.3-dev | apt install php8.3-dev | ||
pecl channel-update pecl.php.net | pecl channel-update pecl.php.net | ||
pecl install apcu | pecl install apcu | ||
</pre> | |||
* You should add "extension=apcu.so" to php.ini | |||
* echo "extension=apcu.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` | |||
= WEB FOLDERS = | |||
==www== | |||
<pre> | |||
cp -r cp -r /opt/www/backup/www/ /var/ && chown -R www-data:www-data /var/www | |||
</pre> | |||
* Crontab : Apache automation | |||
<pre> | |||
3 * * * * /var/www/tools/apache_service_monitor.py | |||
</pre> | |||
== Mediawiki == | |||
<pre> | |||
cd /var/www/rajkumar && mv root root.old && wget https://releases.wikimedia.org/mediawiki/1.43/mediawiki-1.43.1.tar.gz && tar xzvf mediawiki-1.43.1.tar.gz && mv mediawiki-1.43.1 root && chown -R www-data:www-data root && cp -r root.old/images root/ && cp -r root.old/extensions/MsUpload root/extensions/ && cp -r root.old/extensions/Iframe root/extensions/ | |||
rm -fr root && wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.0.tar.gz && tar xzvf mediawiki-1.40.0.tar.gz && mv mediawiki-1.40.0 root && chown -R www-data:www-data root && nano root/LocalSettings.php | |||
</pre> | |||
* Web install and configure | |||
* LocalSettings.php | |||
<pre> | |||
$wgDBserver = "172.20.0.10"; | |||
$wgLocaltimezone = "Asia/Kolkota"; | |||
$wgFavicon = "/images/favicon.png"; | |||
</pre> | |||
* Old Extensions | |||
<pre> | |||
wfLoadExtension( 'MsUpload' ); | |||
wfLoadExtension( 'YouTube' ); | |||
$wgMSU_useDragDrop = true; // Should the drag & drop area be shown? | |||
$wgMSU_showAutoCat = true; // Files uploaded while editing a category page will be added to that category | |||
$wgMSU_checkAutoCat = true; // Whether the checkbox for adding a category to a page is checked by default | |||
$wgMSU_useMsLinks = true; // Insert links in Extension:MsLinks style? | |||
$wgMSU_confirmReplace = true; // Show the "Replace file?" checkbox | |||
$wgMSU_imgParams = '400px'; // Default image parameters, for example "thumb|200px" | |||
$wgMSU_uploadsize = '500mb'; // Max upload size through MsUpload | |||
$wgGroupPermissions['user']['upload'] = true; // Allow regular users to upload files | |||
$wgVerifyMimeType = false; | |||
require_once("/var/www/.config/global_wiki_config.php"); | |||
</pre> | |||
* Protecting the Images in Wiki | |||
Add the following code to ../lampp/etc/httpd.conf | |||
<pre> | |||
<Directory "/var/www/[0-9|a-z]*/root/images"> | |||
AllowOverride None | |||
AddType text/plain .html .htm .shtml .phtml | |||
php_admin_flag engine off | |||
Header set X-Content-Type-Options nosniff | |||
</Directory> | |||
</pre> | |||
== Drupal == | == Drupal == | ||
<pre> | |||
apt install composer | |||
cd /var/www/ && rm -fr idon && wget https://ftp.drupal.org/files/projects/drupal-10.5.0.tar.gz && tar xzvf drupal-10.5.0.tar.gz && mv drupal-10.5.0 idon && chown -R www-data:www-data idon && mkdir idon/sites/default/files && chmod 777 idon/sites/default/files && cp idon/sites/default/default.settings.php idon/sites/default/settings.php && chmod 777 idon/sites/default/settings.php | |||
</pre> | |||
---- | |||
* opcache | |||
*Add this to php.ini | |||
<pre> | |||
[opcache] | |||
zend_extension=opcache.so | |||
openssl.cafile=/opt/lampp/share/curl/curl-ca-bundle.crt | |||
opcache.memory_consumption=256 | |||
opcache.interned_strings_buffer=16 | |||
opcache.max_accelerated_files=6000 | |||
opcache.revalidate_freq=60 | |||
opcache.fast_shutdown=1 ; prior to PHP 7.2.0 | |||
opcache.enable_cli=1 | |||
</pre> | |||
* Set up the web interface | |||
<pre> | |||
chmod 644 idon/sites/default/settings.php | |||
</pre> | |||
---------- | |||
* Extensions Youtube | |||
<pre> | |||
apt-get install php-xml | |||
composer require 'drupal/youtube:^2.0' | |||
composer require drupal/video_embed_field | |||
</pre> | |||
== Encrypt MD5 == | == Encrypt MD5 == | ||
Create a file called wp.txt, containing nothing but the new password. | * Create a file called wp.txt, containing nothing but the new password. | ||
<pre> | |||
tr -d ‘\r\n’ < wp.txt | md5sum | tr -d ‘ -‘ | tr -d ‘\r\n’ < wp.txt | md5sum | tr -d ‘ -‘ | ||
rm wp.txt | rm wp.txt | ||
</pre> | |||
== .htaccess == | |||
* Create a .htaccess file | |||
<pre> | |||
AuthType Basic | |||
AuthName "Restricted Area" | |||
AuthUserFile /etc/apache2/.htpasswd | |||
Require valid-user | |||
</pre> | |||
* Create encrypted password | |||
<pre> | |||
htpasswd -c /var/www/.config/.htpasswd username | |||
</pre> | |||
== SSL Apache config == | |||
<pre> | |||
# SSL horts.in | |||
<VirtualHost *:443> | |||
ServerAdmin r@rajkumar.in | |||
DocumentRoot "/var/www/horts/root" | |||
ServerName horts.in | |||
ServerAlias www.horts.in | |||
SSLEngine on | |||
SSLCertificateFile "/opt/lampp/etc/ssl/rajkumar.in.certificate.crt" | |||
SSLCertificateKeyFile "/opt/lampp/etc/ssl/rajkumar.in.private.key" | |||
SSLCertificateChainFile "/opt/lampp/etc/ssl/rajkumar.in.ca_bundle.crt" | |||
ErrorLog "logs/horts.in-error_log" | |||
CustomLog "logs/horts.in-access_log" common | |||
<Directory "/var/www/horts/root"> | |||
Options Indexes FollowSymLinks MultiViews | |||
AllowOverride all | |||
Order Deny,Allow | |||
Allow from all | |||
Require all granted | |||
</Directory> | |||
</VirtualHost> | |||
</pre> | |||
https://www.rajkumar.in/index.php/Main_Page | |||
https://www.horts.in/index.php/Main_Page | |||
Latest revision as of 03:22, 9 July 2026
SERVER CONFIGURATION
DOCKER
docker pull ubuntu:24.04 docker run -it --name web -p 8080:80 -p 21:21 --network idon ubuntu:24.04
IP
docker network connect --ip 172.17.0.10 idon mysql docker network connect --ip 172.17.0.2 idon web
UPDATE
apt update && upgrade apt install wget nano curl libpam-modules-bin libpam-modules libpam-runtime libpam0g libsystemd0 libudev1 zip rar gzip pigz tar htop net-tools imagemagick php-gd python3 cron libpython3.14-minimal libpython3.14-stdlib python3.14-minimal python3.14 php-fpm
Lampp
cd /opt && wget https://excellmedia.dl.sourceforge.net/project/xampp/XAMPP%20Linux/8.2.12/xampp-linux-x64-8.2.12-0-installer.run && chmod 77 xampp-linux-x64-8.2.12-0-installer.run && ./xampp-linux-x64-8.2.12-0-installer.run
change user / group in httpd.conf as www-data
ProFTP
useradd admin passwd admin groupadd ftp usermod -a -G ftp admin chown root:ftp htdocs chmod 775 htdocs
Mysql
- Separate container
- Assign IP (Refer earlier)
- > map > mkdir /opt/www -> /volume1/www
Restore
./mysql -u rajplus -p -h localhost ak_wiki </opt/www/backup/mysql/ak_wiki.sql
phpmyadmin
- Edit /etc/extra/httpd-xampp.conf
Require all granted
- Access throug web interface and add user and block root
mkdir /opt/save mkdir /opt/upload
- Edit Config.inc.php
declare(strict_types=1); $cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */ $i = 0; $i++; $cfg['Servers'][$i]['auth_type'] = 'http'; $cfg['Servers'][$i]['user'] = 'rajplus'; $cfg['Servers'][$i]['password'] = ''; $cfg['Servers'][$i]['host'] = '172.17.0.7'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false; $cfg['UploadDir'] = '/opt/upload'; $cfg['SaveDir'] = '/opt/save';
APCU
apt install php8.3-dev pecl channel-update pecl.php.net pecl install apcu
- You should add "extension=apcu.so" to php.ini
- echo "extension=apcu.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
WEB FOLDERS
www
cp -r cp -r /opt/www/backup/www/ /var/ && chown -R www-data:www-data /var/www
- Crontab : Apache automation
3 * * * * /var/www/tools/apache_service_monitor.py
Mediawiki
cd /var/www/rajkumar && mv root root.old && wget https://releases.wikimedia.org/mediawiki/1.43/mediawiki-1.43.1.tar.gz && tar xzvf mediawiki-1.43.1.tar.gz && mv mediawiki-1.43.1 root && chown -R www-data:www-data root && cp -r root.old/images root/ && cp -r root.old/extensions/MsUpload root/extensions/ && cp -r root.old/extensions/Iframe root/extensions/ rm -fr root && wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.0.tar.gz && tar xzvf mediawiki-1.40.0.tar.gz && mv mediawiki-1.40.0 root && chown -R www-data:www-data root && nano root/LocalSettings.php
- Web install and configure
- LocalSettings.php
$wgDBserver = "172.20.0.10"; $wgLocaltimezone = "Asia/Kolkota"; $wgFavicon = "/images/favicon.png";
- Old Extensions
wfLoadExtension( 'MsUpload' );
wfLoadExtension( 'YouTube' );
$wgMSU_useDragDrop = true; // Should the drag & drop area be shown?
$wgMSU_showAutoCat = true; // Files uploaded while editing a category page will be added to that category
$wgMSU_checkAutoCat = true; // Whether the checkbox for adding a category to a page is checked by default
$wgMSU_useMsLinks = true; // Insert links in Extension:MsLinks style?
$wgMSU_confirmReplace = true; // Show the "Replace file?" checkbox
$wgMSU_imgParams = '400px'; // Default image parameters, for example "thumb|200px"
$wgMSU_uploadsize = '500mb'; // Max upload size through MsUpload
$wgGroupPermissions['user']['upload'] = true; // Allow regular users to upload files
$wgVerifyMimeType = false;
require_once("/var/www/.config/global_wiki_config.php");
- Protecting the Images in Wiki
Add the following code to ../lampp/etc/httpd.conf
<Directory "/var/www/[0-9|a-z]*/root/images"> AllowOverride None AddType text/plain .html .htm .shtml .phtml php_admin_flag engine off Header set X-Content-Type-Options nosniff </Directory>
Drupal
apt install composer cd /var/www/ && rm -fr idon && wget https://ftp.drupal.org/files/projects/drupal-10.5.0.tar.gz && tar xzvf drupal-10.5.0.tar.gz && mv drupal-10.5.0 idon && chown -R www-data:www-data idon && mkdir idon/sites/default/files && chmod 777 idon/sites/default/files && cp idon/sites/default/default.settings.php idon/sites/default/settings.php && chmod 777 idon/sites/default/settings.php
- opcache
- Add this to php.ini
[opcache] zend_extension=opcache.so openssl.cafile=/opt/lampp/share/curl/curl-ca-bundle.crt opcache.memory_consumption=256 opcache.interned_strings_buffer=16 opcache.max_accelerated_files=6000 opcache.revalidate_freq=60 opcache.fast_shutdown=1 ; prior to PHP 7.2.0 opcache.enable_cli=1
- Set up the web interface
chmod 644 idon/sites/default/settings.php
- Extensions Youtube
apt-get install php-xml composer require 'drupal/youtube:^2.0' composer require drupal/video_embed_field
Encrypt MD5
- Create a file called wp.txt, containing nothing but the new password.
tr -d ‘\r\n’ < wp.txt | md5sum | tr -d ‘ -‘ rm wp.txt
.htaccess
- Create a .htaccess file
AuthType Basic AuthName "Restricted Area" AuthUserFile /etc/apache2/.htpasswd Require valid-user
- Create encrypted password
htpasswd -c /var/www/.config/.htpasswd username
SSL Apache config
# SSL horts.in
<VirtualHost *:443>
ServerAdmin r@rajkumar.in
DocumentRoot "/var/www/horts/root"
ServerName horts.in
ServerAlias www.horts.in
SSLEngine on
SSLCertificateFile "/opt/lampp/etc/ssl/rajkumar.in.certificate.crt"
SSLCertificateKeyFile "/opt/lampp/etc/ssl/rajkumar.in.private.key"
SSLCertificateChainFile "/opt/lampp/etc/ssl/rajkumar.in.ca_bundle.crt"
ErrorLog "logs/horts.in-error_log"
CustomLog "logs/horts.in-access_log" common
<Directory "/var/www/horts/root">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
https://www.rajkumar.in/index.php/Main_Page https://www.horts.in/index.php/Main_Page