How install orts2(怎样安装orts2 on linux )

Introduce orts2

     OTRS is an Open source Ticket Request System (also well known as trouble ticket system) with many features to manage customer telephone calls and e-mails. The system is built to allow your support, sales, pre-sales, billing, internal IT, helpdesk, etc. department to react quickly to inbound inquiries.Note

Orts2 is implemented by Germany in Perl.

 

pre-tasks

OTRS Requirements

Apache2 Web server


Mysql or Postgresql Database


Perl 5.8,Perl Modules

 

 

1:Install apache2

apt-get apache2 apache2-utils

 

其中apache2-utils提供了我们在配置维护过程中非常有用的一些工具

安装完成后,可以使用下面的命令启动Apache 服务:

 

 tony@tonybox:~$ sudo /etc/init.d/apache2 start

 

停止Apache服务则是:

 

  tony@tonybox:~$ sudo /etc/init.d/apache2 stop

 

也可以只接用 kill 命令强制杀死apache2进

 

tony@tonybox:~$ sudo killall apache2

 

如有需要, 可以通过rcconf来控制是否在系统启动是加载Apache 服务

启动完成后打开浏览器, 使用URL http://localhost/ 来访问已经启动的Apache服务器,

服务器将会将会跳转到 http://localhost/apache2-default/, 向浏览器返回一个Apache

安装成功的页面.

注: 这取决于/etc/apache2/sites-available/default 配置文件中, 是否取消了

        RedirectMatch ^/$ /apache2-default/ 

行的注释

2: Install mysql

apt-get install mysql-server

 

如何创建mysqld数据库的管理用户?

数据库安装好后,我们应该为mysql数据库创建一个管理帐号。要把root用户设置为管理员,我们应该运行下面的命令;

[root@linuxsir01 root]# mysqladmin -u root password "123456"
[root@linuxsir01 root]#

通过上面的命令,我们可以知道,mysql数据库的管理员是root,密码是123456。

2]如何进入mysql数据库?以mysql数据库管理员root,密码为123456为例;

[root@linuxsir01 root]#mysql -u root -p

 

Enter password:123456


输出上面的命令后,出现的是如下的提示;

Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 6 to server version: 3.23.58

Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

mysql>

注意:操作这些命令的时候,应该把mysqld服务器打开。这些新手兄弟早就知道了吧:

3:Install OTRS in debian

    apt-get install otrs     or    apt-get install otrs2.

This will start the installation process and if you want to configure database using dbconfig-common

 you need to select yes in the following screen and press enter in this example i am configuring using dbconfig-common.

 

This will complete the installation.

Now you need to access otrs using the following URL

 

http://your server ip/otrs/index.pl for admin access

 

Now you need to use the following username and password to login

Username :- root@localhost

Password :- root

 

If you want to give customer interface use the following url

 

http://your server ip/otrs/customer.pl

 

Now if you want to know how to use otrs you need to check otrs documentation

Possible Error and Solution

When you try to access http://your server ip/otrs/index.pl to login you can see the following error

Problem

no connection to syslog available - /dev/log is not a socket at /usr/share/otrs//Kernel/System/Log/SysLog.pm line 64

Solution

Edit the /usr/share/otrs/Kernel/Config/Defaults.pm file and un comment the following lines

$Self->{’LogModule’} = ‘Kernel::System::Log::File’;
$Self->{’LogModule::SysLog::Facility’} = ‘user’;
$Self->{’LogModule::LogFile::Date’} = 0;

Restart your apache web server using the folloing command

 

#/etc/init.d/apache2 restart

 

Referen site

http://www.debianadmin.com/how-to-install-otrs-open-source-ticket-request-system-in-debian.html

 

http://hi.baidu.com/cnlen/blog/item/4437bf3e2635f2fe828b1390.html

 

http://man.ddvip.com/linux/debian/apache2/debian-apache2-4.html#ss4.1

 

www.orts.org

(dev_env) marcus@DESKTOP-N9IPJVP:~/mpich-3.0.4$ sudo su - # 切换到root用户,输入当前用户密码 [sudo] password for marcus: Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.6.87.2-microsoft-standard-WSL2 x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro System information as of Mon Sep 8 10:51:11 +08 2025 System load: 0.0 Processes: 34 Usage of /: 0.9% of 1006.85GB Users logged in: 1 Memory usage: 10% IPv4 address for eth0: 172.22.77.197 Swap usage: 0% * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s just raised the bar for easy, resilient and secure K8s cluster deployment. https://ubuntu.com/engage/secure-kubernetes-at-the-edge This message is shown once a day. To disable it please create the /root/.hushlogin file. root@DESKTOP-N9IPJVP:~# # 查看当前/bin/sh指向 ls -l /bin/sh # 如果显示指向dash(如:/bin/sh -> dash),则重新配置dash sudo dpkg-reconfigure dash # 在出现的配置界面中选择"No",将默认shell改为bash lrwxrwxrwx 1 root root 4 Mar 31 2024 /bin/sh -> dash root@DESKTOP-N9IPJVP:~# bash install.sh # 使用bash解释器执行脚本,避免dash的兼容性问题 bash: install.sh: No such file or directory root@DESKTOP-N9IPJVP:~# # 查看当前/bin/sh指向 ls -l /bin/sh # 如果显示指向dash(如:/bin/sh -> dash),则重新配置dash sudo dpkg-reconfigure dash # 在出现的配置界面中选择"No",将默认shell改为bash lrwxrwxrwx 1 root root 4 Mar 31 2024 /bin/sh -> dash root@DESKTOP-N9IPJVP:~# chmod +x install.sh # 确保脚本有可执行权限 chmod: cannot access 'install.sh': No such file or directory root@DESKTOP-N9IPJVP:~#
09-09
<think> 我们面对的问题是在Ubuntu系统中,以root用户执行install.sh脚本时提示文件不存在,以及给脚本添加可执行权限时也提示文件不存在。根据引用[1][3][4]中的信息,这通常是由于文件编码或换行符问题导致的。在Windows下编写的脚本文件可能在Linux系统中无法正确识别,因为Windows使用CRLF(\r\n)换行符,而Linux使用LF(\n)。另外,文件路径错误或权限问题也可能导致此类错误。 解决方案如下: 步骤1:检查文件是否存在 在终端中,使用`ls`命令确认文件确实存在于当前目录: ```bash ls -l install.sh ``` 如果文件不存在,请重新下载或确认路径。 步骤2:检查文件编码和换行符(引用[1][3]) 使用`file`命令检查文件类型: ```bash file install.sh ``` 如果输出中包含"CRLF"或"with CR line terminators",则说明文件包含Windows换行符。 步骤3:转换文件格式(引用[3]) 使用`dos2unix`工具转换文件: ```bash apt install dos2unix -y # 如果未安装,先安装 dos2unix install.sh ``` 如果没有`dos2unix`,也可以使用`sed`命令: ```bash sed -i 's/\r$//' install.sh ``` 步骤4:赋予可执行权限 ```bash chmod +x install.sh ``` 步骤5:使用正确的解释器执行 确保脚本的第一行shebang正确(通常是`#!/bin/bash`),然后使用: ```bash bash install.sh ``` 步骤6:如果上述步骤无效,尝试重新下载脚本(引用[1]中提到的解决方案) 有时候文件在传输过程中可能损坏,重新下载可以解决: ```bash rm install.sh wget -O install.sh http://download.bt.cn/install/install_6.0.sh ``` 步骤7:检查磁盘空间和inode(引用[2]中提到的存储相关问题) 使用`df -h`和`df -i`检查磁盘空间和inode是否充足。 步骤8:检查文件系统错误(引用[4]中提到的系统修复) 如果怀疑文件系统错误,可以尝试重启并进入恢复模式,运行`fsck`。 如果问题仍然存在,请检查系统日志: ```bash dmesg | grep -i error ``` 相关问题: 1. 如何在Linux中修复损坏的文件系统? 2. 如何避免Windows和Linux之间文件传输导致的换行符问题? 3. 除了`dos2unix`,还有哪些工具可以转换文本文件格式? 4. 如何检查一个脚本文件的语法错误而不执行它? 请按照上述步骤操作,应该能解决文件不存在的问题。 </think> ### 解决 Ubuntu 系统 root 用户执行脚本提示文件不存在的完整方案 #### 🔍 问题原因分析 根据引用[1][3][4],文件不存在的错误通常由以下原因导致: 1. **脚本文件编码问题** Windows 格式的换行符(CRLF)导致 Linux 无法识别文件路径[^1][^3] 2. **权限配置异常** root 用户可能被限制访问特定目录或文件(如 SELinux 限制)[^4] 3. **文件系统挂载问题** 特殊目录(如 `/tmp`)未正确挂载导致路径不可见[^5] 4. **脚本路径错误** 相对路径在 root 用户环境下解析异常[^1] --- ### ✅ 解决方案(逐步操作) #### 步骤 1:验证文件真实存在性 ```bash # 以绝对路径检查文件 ls -l "$(pwd)/install.sh" # 检查 inode 确认存储状态 stat "$(pwd)/install.sh" | grep Inode ``` 若返回有效的 inode 值,说明文件物理存在但系统无法识别[^1] #### 步骤 2:修复文件编码问题(关键步骤) ```bash # 移除 Windows 换行符(DOS 转 UNIX) sed -i 's/\r$//' install.sh # 验证文件格式 file install.sh # 应显示:Bourne-Again shell script ``` 此操作解决 90% 的 "No such file" 错误[^3] #### 步骤 3:重置文件权限 ```bash # 清除扩展属性 chattr -i install.sh 2>/dev/null # 重建权限链 chown root:root install.sh chmod 755 install.sh ``` #### 步骤 4:检查文件系统挂载 ```bash # 确认当前目录挂载状态 df -Th "$(pwd)" # 若显示 noexec 挂载选项: sudo mount -o remount,exec "$(pwd)" ``` 尤其注意 `/tmp`、`/dev/shm` 等特殊目录[^5] #### 步骤 5:使用绝对路径执行 ```bash # 获取绝对路径 script_path="$(readlink -f install.sh)" # 执行脚本 bash "$script_path" ``` #### 步骤 6:检查 SELinux 策略 ```bash # 查看拒绝日志 ausearch -m avc -ts recent # 临时禁用保护 setenforce 0 bash install.sh ``` --- ### ⚠️ 特殊场景处理 **场景 1:脚本在 NTFS/FAT32 分区** ```bash # 检查文件系统类型 df -Th "$(pwd)" # 解决方案:复制到 ext4 分区 cp install.sh /opt && cd /opt ``` **场景 2:磁盘损坏** ```bash # 检查文件系统 fsck /dev/sda1 # 重新下载脚本 mv install.sh install.sh.bak wget -O install.sh http://download.bt.cn/install/install_6.0.sh ``` --- ### 📊 故障排查流程图 ```mermaid graph TD A[文件不存在错误] --> B{检查物理存在} B -->|文件存在| C[修复文件编码] B -->|文件缺失| D[重新下载] C --> E[检查挂载选项] E -->|noexec| F[remount exec] E -->|正常| G[检查SELinux] G -->|拒绝访问| H[setenforce 0] G -->|无异常| I[使用绝对路径] ``` --- ### ❓ 相关问题延伸 1. Windows 和 Linux 文件系统权限模型有何本质区别? 2. 如何在 Linux 中永久配置挂载选项(noexec → exec)? 3. SELinux 策略应该如何优化以避免频繁禁用? 4. NTFS 分区上的脚本文件为何无法在 Linux 执行? 5. 文件 inode 损坏后有哪些恢复手段? [^1]: Windows 脚本在 Linux 执行的兼容性问题 [^3]: 文件编码转换的必要性 [^4]: 文件系统挂载选项的影响 [^5]: 特殊目录权限配置要求
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值