Invalid command 'AssignUserId', perhaps misspelled or defined by a module not included in the server

环境

Ubuntu 18.04.3 + Apache 2.4.29

目标:AssignUserId www-data www-data

 

解决办法

  1. sudo apt-get install libapache2-mpm-itk
  2. sudo a2enmod mpm_itk
  3. sudo apache2ctl restart

 

完整过程

root@weVPS:/etc/apache2/sites-enabled# cat demo.com.conf
<VirtualHost *:80>	
	ServerName demo.com
	DocumentRoot /var/www/democom/
	AssignUserId www-data www-data	
	ErrorLog /var/log/apache2/demo.log
</VirtualHost>
root@weVPS:/etc/apache2/sites-enabled# apache2ctl restart
AH00526: Syntax error on line 4 of /etc/apache2/sites-enabled/demo.com.conf:
Invalid command 'AssignUserId', perhaps misspelled or defined by a module not included in the server configuration
Action 'restart' failed.
The Apache error log may have more information.
root@weVPS:/etc/apache2/sites-enabled# cd ../mods-available/
root@weVPS:/etc/apache2/mods-available# 
root@weVPS:/etc/apache2/mods-available# ls mpm*
mpm_event.conf  mpm_event.load  mpm_prefork.conf  mpm_prefork.load  mpm_worker.conf  mpm_worker.load
root@weVPS:/etc/apache2/mods-available# 
root@weVPS:/etc/apache2/mods-available# apt-get install libapache2-mpm-itk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libapache2-mpm-itk
0 upgraded, 1 newly installed, 0 to remove and 93 not upgraded.
Need to get 10.8 kB of archives.
After this operation, 45.1 kB of additional disk space will be used.
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu bionic/universe amd64 libapache2-mpm-itk amd64 2.4.7-04-1 [10.8 kB]
Fetched 10.8 kB in 0s (585 kB/s)        
Selecting previously unselected package libapache2-mpm-itk.
(Reading database ... 112513 files and directories currently installed.)
Preparing to unpack .../libapache2-mpm-itk_2.4.7-04-1_amd64.deb ...
Unpacking libapache2-mpm-itk (2.4.7-04-1) ...
Setting up libapache2-mpm-itk (2.4.7-04-1) ...
apache2_invoke: Enable module mpm_itk
root@weVPS:/etc/apache2/mods-available# 
root@weVPS:/etc/apache2/mods-available# ls mpm*
mpm_event.conf  mpm_event.load  mpm_itk.load  mpm_prefork.conf  mpm_prefork.load  mpm_worker.conf  mpm_worker.load
root@weVPS:/etc/apache2/mods-available# cd /etc/apache2/mods-enabled/
root@weVPS:/etc/apache2/mods-enabled# ln -s ../mods-available/mpm_itk.load .
ln: failed to create symbolic link './mpm_itk.load': File exists
root@weVPS:/etc/apache2/mods-enabled# 
root@weVPS:/etc/apache2/mods-enabled# apache2ctl restart
root@weVPS:/etc/apache2/mods-enabled# 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Rudon滨海渔村

花的越多,赚得越多...

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值