阿里云如何配置apache

阿里云如何配置apache,第1张

登录到阿里云服务器上,在控制终端输入以下命令:

yum install >

然后开始下载安装,下载过程会提示以下信息,只需要输入y即可继续安装。

当出现complete!字样时即表示安装完成,如下图所示。

然后我们设置成开机自启动,命令如下:

chkconfig --levels 235 >

配置完毕,启动 Apache:

systemctl start >

此时已经可以访问你的服务器,l输入ip地址,不出意外的话,能够看到 “Testing 123" 的测试页面。

如果其他机器访问这台服务无法显示这个页面,而直接在这台服务器上可以访问的话,可能是 CentOS 自带的防火墙禁止了。只需要进入防火墙,将 “>

END

注意事项

默认根目录是 /var/>

配置文件 /etc/>

其他配置存储在 /etc/>您好看,方法
1、首先在命令窗口中,进入到下载好的apacherpm包所在的目录中。
2、输入命令:rpm -ivh apache-136i386rpm。
3、输入命令后我们回车执行安装,但是报错。
4、我们尝试使用--force的参数强制安装,但是仍然报错。分析后,主要原因是有依赖包未安装的原因导致。
5、我们尝试加上 --nodeps 属性,不考虑依赖关系进行安装。
6、果然,添加--nodeps的参数之后,就能成功安装了。

controller

@RequestMapping("assign2/downloadAssignWayConfigHistorydo")
public void downloadAssignWayConfigHistory(>}

service

public void exportAssignCaseWayHistory(String[] exceltitles,
ArrayList<Map<String, Object>> excelDatas, OutputStream out) {
try{
// 第一步,创建一个workbook,对应一个Excel文件
HSSFWorkbook workbook = new HSSFWorkbook();
// 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet
HSSFSheet hssfSheet = workbookcreateSheet("sheet1");
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
HSSFRow row = hssfSheetcreateRow(0);
//不带背景颜色居中的cellStyle
HSSFCellStyle hssfCellStyle = workbookcreateCellStyle();
//居中
hssfCellStylesetAlignment(HSSFCellStyleALIGN_CENTER);
hssfCellStylesetVerticalAlignment(hssfCellStyleVERTICAL_CENTER);
//带背景和字体颜色并且居中的cellStyle
HSSFCellStyle hssfCellStyleWithBackgroundColor = workbookcreateCellStyle();
//居中
hssfCellStyleWithBackgroundColorsetAlignment(HSSFCellStyleALIGN_CENTER);
hssfCellStyleWithBackgroundColorsetVerticalAlignment(hssfCellStyleVERTICAL_CENTER);
//背景
hssfCellStyleWithBackgroundColorsetFillForegroundColor(IndexedColorsYELLOWgetIndex());
hssfCellStyleWithBackgroundColorsetFillPattern(hssfCellStyleSOLID_FOREGROUND);
//字体
HSSFFont font = workbookcreateFont();
fontsetColor(HSSFColorREDindex);
hssfCellStyleWithBackgroundColorsetFont(font);
HSSFCell hssfCell = null;
for (int i = 0; i < exceltitleslength; i++) {
hssfCell = rowcreateCell(i);//列索引从0开始
hssfCellsetCellValue(exceltitles[i]);//列名1
hssfCellsetCellStyle(hssfCellStyle);//列居中显示
//设置列宽
if (i == 1 || i == 6 || i == 7) {
hssfSheetsetColumnWidth(i, 5000);
}else {
hssfSheetsetColumnWidth(i, 3000);
}
}
// 第五步,写入实体数据           
for (int i = 0; i < excelDatassize(); i++) {
row = hssfSheetcreateRow(2i+1); //奇数行       
Map<String, Object> excelData = excelDatasget(i);
// 第六步,创建单元格,并设置值
String updateBy = (String) excelDataget("updateBy");
String updateDate = (String) excelDataget("updateDate");
String region = (String) excelDataget("region");
String branch = (String) excelDataget("branch");
String center = (String) excelDataget("center");
String dept = (String) excelDataget("dept");
String assignMode = (String) excelDataget("assignMode");
String newAssignMode = (String) excelDataget("newAssignMode");
String turnableDimension = (String) excelDataget("turnableDimension");
String newTurnableDimension = (String) excelDataget("newTurnableDimension");
String M0 = (String) excelDataget("M0");
String M1 = (String) excelDataget("M1");
String M2 = (String) excelDataget("M2");
String M3 = (String) excelDataget("M3");
String newM0 = (String) excelDataget("newM0");
String newM1 = (String) excelDataget("newM1");
String newM2 = (String) excelDataget("newM2");
String newM3 = (String) excelDataget("newM3");
HSSFCell cell0 = rowcreateCell(0);
cell0setCellStyle(hssfCellStyle);
cell0setCellValue(updateBy);
HSSFCell cell1 = rowcreateCell(1);
cell1setCellStyle(hssfCellStyle);
cell1setCellValue(updateDate);
HSSFCell cell2 = rowcreateCell(2);
cell2setCellStyle(hssfCellStyle);
cell2setCellValue(region);
HSSFCell cell3 = rowcreateCell(3);
cell3setCellStyle(hssfCellStyle);
cell3setCellValue(branch);
HSSFCell cell4 = rowcreateCell(4);
cell4setCellStyle(hssfCellStyle);
cell4setCellValue(center);
HSSFCell cell5 = rowcreateCell(5);
cell5setCellStyle(hssfCellStyle);
cell5setCellValue(dept);
HSSFCell cell6 = rowcreateCell(6);
cell6setCellStyle(hssfCellStyle);
cell6setCellValue(assignModeequals("0")"模式1":"模式2");
if ("BRANCH"equals(turnableDimension)) {
turnableDimension = "分部";
} else if ("CENTER"equals(turnableDimension)) {
turnableDimension = "中心";
} else if ("DEPT"equals(turnableDimension)) {
turnableDimension = "部";
}
HSSFCell cell7 = rowcreateCell(7);
cell7setCellStyle(hssfCellStyle);
cell7setCellValue(turnableDimension);
HSSFCell cell8 = rowcreateCell(8);
cell8setCellStyle(hssfCellStyle);
cell8setCellValue(M0equalsIgnoreCase("Y")"案2":"案2");
HSSFCell cell9 = rowcreateCell(9);
cell9setCellStyle(hssfCellStyle);
cell9setCellValue(M1equalsIgnoreCase("Y")"案1":"案2");
HSSFCell cell10 = rowcreateCell(10);
cell10setCellStyle(hssfCellStyle);
cell10setCellValue(M2equalsIgnoreCase("Y")"案1":"案2");
HSSFCell cell11 = rowcreateCell(11);
cell11setCellStyle(hssfCellStyle);
cell11setCellValue(M3equalsIgnoreCase("Y")"案1":"案2");
row = hssfSheetcreateRow(2i+2); //偶数行 
HSSFCell newCell6 = rowcreateCell(6);
newCell6setCellValue(newAssignModeequals("0")"模式1":"模式2");//设置值
if (!newAssignModeequals(assignMode)){//设置背景色
newCell6setCellStyle(hssfCellStyleWithBackgroundColor);
}else {
newCell6setCellStyle(hssfCellStyle);
}
if ("BRANCH"equals(newTurnableDimension)) {
newTurnableDimension = "haha";
} else if ("CENTER"equals(newTurnableDimension)) {
newTurnableDimension = "hehe";
} else if ("DEPT"equals(newTurnableDimension)) {
newTurnableDimension = "hiahia";
}
HSSFCell newCell7 = rowcreateCell(7);
newCell7setCellValue(newTurnableDimension);
if (!newTurnableDimensionequals(turnableDimension)){//设置背景色
newCell7setCellStyle(hssfCellStyleWithBackgroundColor);
}else {
newCell7setCellStyle(hssfCellStyle);
}
HSSFCell newCell8 = rowcreateCell(8);
newCell8setCellValue(newM0equalsIgnoreCase("Y")"案1":"案2");
if (!newM0equals(M0)){//设置背景色
newCell8setCellStyle(hssfCellStyleWithBackgroundColor);
}else {
newCell8setCellStyle(hssfCellStyle);
}
HSSFCell newCell9 = rowcreateCell(9);
newCell9setCellValue(newM1equalsIgnoreCase("Y")"案1":"案2");
if (!newM1equals(M1)){//设置背景色
newCell9setCellStyle(hssfCellStyleWithBackgroundColor);
}else {
newCell9setCellStyle(hssfCellStyle);
}
HSSFCell newCell10 = rowcreateCell(10);
newCell10setCellValue(newM2equalsIgnoreCase("Y")"案1":"案2");
if (!newM2equals(M2)){//设置背景色
newCell10setCellStyle(hssfCellStyleWithBackgroundColor);
}else {
newCell10setCellStyle(hssfCellStyle);
}
HSSFCell newCell11 = rowcreateCell(11);
newCell11setCellValue(newM3equalsIgnoreCase("Y")"案1":"案2");
if (!newM3equals(M3)){//设置背景色
newCell11setCellStyle(hssfCellStyleWithBackgroundColor);
}else {
newCell11setCellStyle(hssfCellStyle);
}
//合并单元格
for (int j = 0; j < 6; j++){
CellRangeAddress cellRangeAddress = new CellRangeAddress(2i+1, 2i+2, j, j);
hssfSheetaddMergedRegion(cellRangeAddress);
}
}
// 第七步,将文件输出到客户端浏览器
try {
workbookwrite(out);
outflush();
outclose();
} catch (Exception e) {
eprintStackTrace();
}
}catch(Exception e){
eprintStackTrace();
}
}


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/13404095.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-29
下一篇 2023-07-29

发表评论

登录后才能评论

评论列表(0条)