Архив

Архив раздела ‘Linux’
28 сентября 2022 Нет комментариев

Например, изменить расширение файлов с .jpg-productpagedesktop на .jpg

mmv \*.jpg-productpagedesktop \#1.jpg
Categories: Linux Tags:

Проблема с версиями по умолчанию на centos 8.
php.ini

max_execution_time=14400

httpd.conf

Timeout 14400

в начале выполнения долгого скрипта:

echo ' ';

https://stackoverflow.com/questions/57677878/http-504-gateway-timeout-apache-2-4-6

Categories: Linux Tags:
17 апреля 2022 Нет комментариев

При попытке экспорта:

mysqldump --opt -uuser -ppassword db | gzip -c -9 > db.sql.gz

получаем ошибку:

Got error: 1016: "Can't open file: './db/table.frm' (errno: 24)" when using LOCK TABLES

использовать --lock-tables=false

mysqldump --opt -uuser -ppassword db --lock-tables=false | gzip -c -9 > db.sql.gz
Categories: Linux Tags: ,
25 февраля 2022 Нет комментариев
hostnamectl set-hostname site.ru
yum update
yum install mc
mcedit ~/.bash_profile
	export EDITOR=mcedit
 
##apache
yum install httpd
systemctl start httpd.service
systemctl enable httpd.service
 
##mysql
yum install mariadb-server mariadb
systemctl start mariadb
mysql_secure_installation
systemctl enable mariadb.service
 
##php centos 8
yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-json
 
##php centos 7
#yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
#yum -y install yum-utils
yum-config-manager --enable remi-php74
yum update
yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json
 
##firewall
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
 
##vhosts
mcedit /etc/httpd/conf.d/0default.conf
<VirtualHost *:80>
	ServerName site.local
	ServerAdmin webmaster@site.ru
	DocumentRoot /var/www/html
	ErrorLog /var/log/httpd/default_error.log
	CustomLog /var/log/httpd/default_access.log combined
</VirtualHost>
mkdir /var/www/site.ru
mcedit /etc/httpd/conf.d/site.ru.conf
<VirtualHost *:80>
	ServerName site.ru
	ServerAlias www.site.ru
	ServerAdmin webmaster@site.ru
	DocumentRoot /var/www/site.ru
	ErrorLog /var/log/httpd/site.ru_error.log
	CustomLog /var/log/httpd/site.ru_access.log combined
</VirtualHost>
 
##php.ini
mcedit /etc/php.ini
	short_open_tag = On
	upload_max_filesize = 2048M
	max_file_uploads = 1000
	post_max_size = 8192M
	max_execution_time = 14400
	max_input_time = 28800
	max_input_vars = 10000
	memory_limit = 4096M
 
##apache conf
mcedit /etc/httpd/conf/httpd.conf
	AllowOverride All
 
##restart apache
apachectl restart
 
##disable MySQL Strict Mode
mcedit /etc/my.cnf
	sql_mode=NO_ENGINE_SUBSTITUTION
service mariadb restart
 
##export db from old server
mysqldump -uDB_USER -p -h localhost DB_NAME > dump.sql
 
##import db
mysql -uDB_USER -p -h localhost DB_NAME < dump.sql
 
##files
chown -R apache:apache /var/www/site.ru/
find /var/www/site.ru/ -type d -exec chmod 775 {} \;
find /var/www/site.ru/ -type f -exec chmod 664 {} \;
 
##lets encrypt
#yum install epel-release
yum install snapd
systemctl enable --now snapd.socket
ln -s /var/lib/snapd/snap /snap
reboot
snap install core
snap refresh core
snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot
yum install mod_ssl
apachectl restart
certbot --apache
 
##processlist
mysqladmin -uDB_USER -p -i 1 processlist
Categories: Linux Tags:
24 февраля 2022 Нет комментариев
dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf distro-sync
Categories: Linux Tags:
6 апреля 2021 Нет комментариев
setsebool -P httpd_can_network_connect_db 1

To check SELinux

sestatus

To see what flags are set on httpd processes

getsebool -a | grep httpd

To allow Apache to connect to remote database through SELinux

setsebool httpd_can_network_connect_db 1

Use -P option makes the change permanent. Without this option, the boolean would be reset to 0 at reboot.

setsebool -P httpd_can_network_connect_db 1
Categories: Linux Tags:
2 апреля 2021 Нет комментариев

Ошибка 403:

[Fri Apr 02 12:24:00.736446 2021] [core:error] [pid 8173] (13)Permission denied: [client xxx.xxx.xxx.xxx:65053] AH00035: access to /a.php denied (filesystem path '/var/www/html/a.php') because search permissions are missing on a component of the path

Выполнить:

chcon -R --type=httpd_sys_rw_content_t /var/www/
Categories: Linux Tags: